apache / apache/iceberg

Docs: Fix type mismatch in JDBC catalog Java API example

Open Beginner friendly
#17,083 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.