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

Support register_table and unregister_table procedures in Iceberg JDBC catalog #15874

Merged
merged 1 commit into from
Feb 14, 2023

Conversation

ebyhr
Copy link
Member

@ebyhr ebyhr commented Jan 27, 2023

Description

Support register_table and unregister_table procedures in Iceberg JDBC catalog
Fixes #15853

Release notes

(x) Release notes are required, with the following suggested text:

# Iceberg
* Add support for `register_table` and `unregister_table` procedures in JDBC catalog. ({issue}`15853`)

@cla-bot cla-bot bot added the cla-signed label Jan 27, 2023
@ebyhr ebyhr self-assigned this Jan 27, 2023
@ebyhr ebyhr force-pushed the ebi/iceberg-jdbc-unregister-table branch from 2fca4f1 to 6436ac9 Compare February 14, 2023 00:06
@ebyhr ebyhr force-pushed the ebi/iceberg-jdbc-unregister-table branch from 6436ac9 to 6664d0e Compare February 14, 2023 07:11
@@ -60,6 +73,14 @@ protected QueryRunner createQueryRunner()
warehouseLocation = Files.createTempDirectory("test_iceberg_jdbc_catalog_smoke_test").toFile();
closeAfterClass(() -> deleteRecursively(warehouseLocation.toPath(), ALLOW_INSECURE));
TestingIcebergJdbcServer server = closeAfterClass(new TestingIcebergJdbcServer());
jdbcCatalog = (JdbcCatalog) buildIcebergCatalog("tpch", ImmutableMap.<String, String>builder()
.put(CATALOG_IMPL, JdbcCatalog.class.getName())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I'd rather avoid using static imports for these properties. Their names are rather generic and this can turn out to be error prone in the maintenance.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CATALOG_IMPL comes from CatalogProperties class. I don't feel qualified access improves anything.

@ebyhr ebyhr requested review from electrum and phd3 February 14, 2023 07:38
Copy link
Member

@phd3 phd3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -186,13 +190,15 @@ public Transaction newCreateTableTransaction(ConnectorSession session, SchemaTab
@Override
public void registerTable(ConnectorSession session, SchemaTableName tableName, String tableLocation, String metadataLocation)
{
throw new TrinoException(NOT_SUPPORTED, "registerTable is not supported for Iceberg JDBC catalogs");
jdbcClient.createTable(tableName.getSchemaName(), tableName.getTableName(), metadataLocation);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add the reason behind not using the jdbc catalogs' register table (seems like Cannot invoke "org.apache.iceberg.util.SerializableSupplier.get()" because "this.hadoopConf" is null) so that someone doesn't try to "optimize" this by removing jdbcClient object that's being used for this specific purpose? Or when the underlying code gets fixed - we can update this.

@ebyhr ebyhr force-pushed the ebi/iceberg-jdbc-unregister-table branch from 6664d0e to 6d00587 Compare February 14, 2023 22:16
@ebyhr ebyhr merged commit ead3432 into trinodb:master Feb 14, 2023
@ebyhr ebyhr deleted the ebi/iceberg-jdbc-unregister-table branch February 14, 2023 22:33
@ebyhr ebyhr mentioned this pull request Feb 14, 2023
@github-actions github-actions bot added this to the 407 milestone Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Add support for register_table and unregister_table procedures in Iceberg JDBC catalog
5 participants