Iceberg-specific JDBC catalog properties should not be passed to driver
Apache Iceberg version
1.9.2 (latest release)
Query engine
None
Please describe the bug 🐞
Iceberg uses a number of config options prefixed with jdbc. internally, of which jdbc.schema-version is effectively mandatory, as you get a warning without it and need to set it in order for JdbcCatalog to support views.
The comment on SCHEMA_VERSION_PROPERTY, "property to control if view support is added to the existing database", is a bit misleading, because it also has to be set for view support to be added to newly-created tables, since it defaults to running V0_CREATE_CATALOG_SQL.
The problem is that Iceberg passes all properties prefixed with jdbc. to the driver when creating a new connection, stripping the prefix, and some JDBC drivers fail when they encounter unknown properties.
@Override
protected Connection newClient() {
try {
Properties dbProps = JdbcUtil.filterAndRemovePrefix(properties, JdbcCatalog.PROPERTY_PREFIX);
return DriverManager.getConnection(dbUrl, dbProps);
} catch (SQLException e) {
throw new UncheckedSQLException(e, "Failed to connect: %s", dbUrl);
}
}
Ideally, there would be separate prefixes to distinguish properties meant to configure Iceberg's JdbcCatalog from those meant to be passed through to the driver.
To (mostly) maintain backwards compatibility, though, a compromise could be to filter out those Iceberg-specific properties from the set passed to the driver.
I believe there are just three:
jdbc.strict-modejdbc.schema-versionjdbc.init-catalog-tables
I can't think of a reason these would need to be passed to the driver.
Willingness to contribute
- [x] I can contribute a fix for this bug independently
- [ ] I would be willing to contribute a fix for this bug with guidance from the Iceberg community
- [ ] I cannot contribute a fix for this bug at this time
This issue has been automatically marked as stale because it has been open for 180 days with no activity. It will be closed in next 14 days if no further activity occurs. To permanently prevent this issue from being considered stale, add the label 'not-stale', but commenting on the issue is preferred when possible.
I'm still seeking a review for this.
This issue has been automatically marked as stale because it has been open for 180 days with no activity. It will be closed in next 14 days if no further activity occurs. To permanently prevent this issue from being considered stale, add the label 'not-stale', but commenting on the issue is preferred when possible.
At least a single reply to this longstanding issue would be appreciated. Does the project have no triage/review process?
#13673 by @patricklucas fixed this, but the stale bot closed it in January before it got a review. @patricklucas, if you'd like to open it again as a new PR, please go ahead; otherwise I'd like to pick it up and credit your work. The plan is to exclude Iceberg's own jdbc. catalog properties (strict-mode, schema-version, init-catalog-tables and the newer metadata-refresh-max-retries) from the properties passed to the JDBC driver.
@binarybrain-009 you're welcome to take it over, thanks.