Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Iceberg Glue Catalog #1

Open
wants to merge 1 commit into
base: acryl-main
Choose a base branch
from
Open
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 @@ -36,6 +36,8 @@ public class IcebergHandler implements CatalogHandler {
private final OpenLineageContext context;

private static final String TYPE = "type";
private static final String CATALOG_IMPL = "catalog-impl";
private static final String IO_IMPL = "io-impl";

public IcebergHandler(OpenLineageContext context) {
this.context = context;
Expand Down Expand Up @@ -79,14 +81,24 @@ public DatasetIdentifier getDatasetIdentifier(
Map.Entry::getValue));

log.info(catalogConf.toString());
if (catalogConf.isEmpty() || !catalogConf.containsKey(TYPE)) {
if (catalogConf.isEmpty() || (!catalogConf.containsKey(TYPE) && !catalogConf.get(CATALOG_IMPL).equals("org.apache.iceberg.aws.glue.GlueCatalog"))) {
throw new UnsupportedCatalogException(catalogName);
}
log.info(catalogConf.get(TYPE));

String warehouse = catalogConf.get(CatalogProperties.WAREHOUSE_LOCATION);
DatasetIdentifier di = PathUtils.fromPath(new Path(warehouse, identifier.toString()));
DatasetIdentifier di;

if (catalogConf.get(CATALOG_IMPL).equals("org.apache.iceberg.aws.glue.GlueCatalog")) {
di = new DatasetIdentifier(
identifier.toString(),
"glue"
);
log.info("Glue catalog detected, returning glue dataset identifier {}", di);
return di;
} else {
di = PathUtils.fromPath(new Path(warehouse, identifier.toString()));
}
if (catalogConf.get(TYPE).equals("hive")) {
di.withSymlink(
getHiveIdentifier(
Expand Down