Skip to content

HIVE-29560: Fix JdbcColumn DECIMAL class mapping to BigDecimal#6424

Open
kezhuoquan wants to merge 1 commit intoapache:masterfrom
kezhuoquan:HIVE-29560
Open

HIVE-29560: Fix JdbcColumn DECIMAL class mapping to BigDecimal#6424
kezhuoquan wants to merge 1 commit intoapache:masterfrom
kezhuoquan:HIVE-29560

Conversation

@kezhuoquan
Copy link
Copy Markdown

What changes were proposed in this pull request?

JdbcColumn.columnClassName() currently maps Types.DECIMAL to
BigInteger.class.getName(), which is incorrect for DECIMAL semantics.
This PR changes the mapping to BigDecimal.class.getName().

Why are the changes needed?

JDBC DECIMAL should map to java.math.BigDecimal, not BigInteger.
The current behavior may cause type mismatch and incorrect metadata
interpretation by JDBC clients.

Does this PR introduce any user-facing change?

Yes.
For DECIMAL columns, JDBC metadata now reports
java.math.BigDecimal as the column class name.

How was this patch tested?

  • Built JDBC module successfully:
    • mvn -pl jdbc -DskipTests compile
  • Verified code change in:
    • jdbc/src/java/org/apache/hive/jdbc/JdbcColumn.java

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants