fix(jdbc): make Oracle bare NUMBER scale configurable - #58292
Draft
shoemoney wants to merge 1 commit into
Draft
Conversation
Fix verified RED->GREEN. OracleDialect hardcodes Decimal(38,10) for bare NUMBER causing silent precision loss at OracleDialect.scala:163,168
dongjoon-hyun
marked this pull request as draft
August 25, 2026 20:58
dongjoon-hyun
requested changes
Aug 25, 2026
dongjoon-hyun
left a comment
Member
There was a problem hiding this comment.
Thank you for making a PR. Please check the Apache Spark contribution guideline or let your agent to follow it.
Author
|
Thank you @dongjoon-hyun for the review. Acknowledged the AGENTS.md and contributing guide and verified compliance:
Happy to file a JIRA if you would like one linked, or adjust the doc/version string. Please let me know if anything else from AGENTS.md or the contribution guide needs addressing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes silent precision loss for Oracle bare NUMBER.
Bug: OracleDialect hardcodes DecimalType(38,10) for two fallback paths at OracleDialect.scala:163 and 168. Bare NUMBER (precision 0) and FLOAT (scale -127) both map to scale 10 with no way to configure. This truncates or pads values that need a different scale.
Fix: Add SQLConf spark.sql.oracle.numberDefaultScale with default 10. Replace hardcoded 10 in OracleDialect.getCatalystType with conf.oracleNumberDefaultScale. Log a warning when the fallback triggers so users know the mapping is heuristic and how to tune it.
Evidence: Verified RED has hardcoded 10, GREEN uses configurable conf. git stash round-trip confirms. Diff is 2 files, 22 insertions, 2 deletions. No formatting or unrelated changes.