Skip to content

[Bug] Fix mapping for DECIMAL type to BigDecimal in JdbcColumn#7393

Open
kezhuoquan wants to merge 1 commit intoapache:masterfrom
kezhuoquan:fix-jdbc-decimal-mapping
Open

[Bug] Fix mapping for DECIMAL type to BigDecimal in JdbcColumn#7393
kezhuoquan wants to merge 1 commit intoapache:masterfrom
kezhuoquan:fix-jdbc-decimal-mapping

Conversation

@kezhuoquan
Copy link
Copy Markdown

@kezhuoquan kezhuoquan commented Apr 9, 2026

Why are the changes needed?

In JDBC/Java, SQL DECIMAL/NUMERIC must map to java.math.BigDecimal to preserve precision and scale. The current implementation maps DECIMAL to java.math.BigInteger, which drops fractional parts and causes type mismatches.

How was this patch tested?

Existing tests passing indicates no regressions.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Trae AI (GPT-5-high)

This commit fixes a bug where the DECIMAL type was incorrectly mapped to BigInteger instead of BigDecimal in JdbcColumn, causing type mismatch issues.
@pan3793
Copy link
Copy Markdown
Member

pan3793 commented Apr 9, 2026

@kezhuoquan, this seems to be a bug inherited from upstream Hive

https://github.com/apache/hive/blob/branch-4.2/jdbc/src/java/org/apache/hive/jdbc/JdbcColumn.java#L100

Side notes: review your AI-generated PR description before sending publicly, such a small change is not worth such a long article to describe.

@kezhuoquan
Copy link
Copy Markdown
Author

@kezhuoquan, this seems to be a bug inherited from upstream Hive

https://github.com/apache/hive/blob/branch-4.2/jdbc/src/java/org/apache/hive/jdbc/JdbcColumn.java#L100

Side notes: review your AI-generated PR description before sending publicly, such a small change is not worth such a long article to describe.

So I can only fix this bug in Hive?

@pan3793
Copy link
Copy Markdown
Member

pan3793 commented Apr 10, 2026

@kezhuoquan, we usually follow the upstream-first strategy.

I suggest you report and fix this bug in the Hive project first, then port the fix here.

@kezhuoquan
Copy link
Copy Markdown
Author

@kezhuoquan, we usually follow the upstream-first strategy.

I suggest you report and fix this bug in the Hive project first, then port the fix here.

ok

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