-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Conversation
2fca4f1
to
6436ac9
Compare
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/jdbc/TrinoJdbcCatalog.java
Show resolved
Hide resolved
6436ac9
to
6664d0e
Compare
@@ -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()) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @alexjo2144
@@ -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); |
There was a problem hiding this comment.
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.
6664d0e
to
6d00587
Compare
Description
Support
register_table
andunregister_table
procedures in Iceberg JDBC catalogFixes #15853
Release notes
(x) Release notes are required, with the following suggested text: