iceberg icon indicating copy to clipboard operation
iceberg copied to clipboard

Docs: Fix type mismatch in JDBC catalog Java API example

Open thswlsqls opened this issue 4 months ago • 1 comments

Apache Iceberg version main @ 49b89a8c5

Query engine None (Java API / JDBC catalog)

Please describe the bug The JDBC catalog Java API example in docs/docs/jdbc.md (line 68) assigns the result of CatalogUtil.buildIcebergCatalog("test_jdbc_catalog", properties, hadoopConf) directly to a JdbcCatalog variable. CatalogUtil.buildIcebergCatalog(String, Map<String, String>, Object) (core/src/main/java/org/apache/iceberg/CatalogUtil.java line 312) returns Catalog, its only declared return type, not JdbcCatalog. Assigning Catalog to a JdbcCatalog variable without an explicit cast is an "incompatible types" compile error.

Steps to reproduce Copy the code block from docs/docs/jdbc.md line 60-68 into a Java file and compile: fails with incompatible types: Catalog cannot be converted to JdbcCatalog.

Additional context N/A.

thswlsqls avatar Jul 03 '26 22:07 thswlsqls

#17086 by @thswlsqls was approved but closed by the stale bot in September before it was merged, and its branch has since been deleted. @thswlsqls, if you'd like to reopen it, please go ahead; otherwise I'll open a one-line PR that declares the variable as Catalog, which is what CatalogUtil.buildIcebergCatalog returns and what the Nessie page does.

yusufyildiz34 avatar Oct 30 '26 08:10 yusufyildiz34