Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ protected void initLocalObjectsImpl() {
metadataOps = ops;
}

/**
* Returns the underlying {@link Catalog} instance used by this external catalog.
*
* <p><strong>Warning:</strong> This method does not handle any authentication logic. If the
* returned catalog implementation relies on external systems
* that require authentication — especially in environments where Kerberos is enabled — the caller is
* fully responsible for ensuring the appropriate authentication has been performed <em>before</em>
* invoking this method.
* <p>Failing to authenticate beforehand may result in authorization errors or IO failures.
*
* @return the underlying catalog instance
*/
public Catalog getCatalog() {
makeSureInitialized();
return ((IcebergMetadataOps) metadataOps).getCatalog();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,14 @@ public IcebergExternalTable buildTableInternal(String remoteTableName, String lo
}

public String getLocation() {
Map<String, String> props = ((SupportsNamespaces) ((IcebergExternalCatalog) getCatalog()).getCatalog())
.loadNamespaceMetadata(Namespace.of(name));
return props.getOrDefault("location", "");
try {
return extCatalog.getPreExecutionAuthenticator().execute(() -> {
Map<String, String> props = ((SupportsNamespaces) ((IcebergExternalCatalog) getCatalog()).getCatalog())
.loadNamespaceMetadata(Namespace.of(name));
return props.getOrDefault("location", "");
});
} catch (Exception e) {
throw new RuntimeException("Failed to get location for Iceberg database: " + name, e);
}
}
}