Docs: Fix type mismatch in JDBC catalog Java API example
- Dominant language
- Java
- Stars
- 9.2k
- Forks
- 3.5k
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 129
Description
**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, 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.
Contributor guide
Research direction
Open docs/docs/jdbc.md around line 68 and compare the example with CatalogUtil.buildIcebergCatalog in core/src/main/java/org/apache/iceberg/CatalogUtil.java around line 312. Compile the copied Java example to confirm the type mismatch is resolved, and ensure the documented example uses the API's declared return type.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 85/100