这是indexloc提供的服务,不要输入任何密码
Skip to content

Iceberg-specific JDBC catalog properties should not be passed to driver #13672

@patricklucas

Description

@patricklucas

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.

In JdbcClientPool.java:

  @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-mode
  • jdbc.schema-version
  • jdbc.init-catalog-tables

I can't think of a reason these would need to be passed to the driver.

Willingness to contribute

  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions