[SPARK-56738][SQL] Make Oracle bare NUMBER default scale configurable - #57795
Open
ruchi-mish90 wants to merge 5 commits into
Open
[SPARK-56738][SQL] Make Oracle bare NUMBER default scale configurable#57795ruchi-mish90 wants to merge 5 commits into
ruchi-mish90 wants to merge 5 commits into
Conversation
ruchi-mish90
force-pushed
the
fix-56738-oracle-number-scale
branch
from
August 6, 2026 14:44
8483c31 to
d9c3da4
Compare
ruchi-mish90
force-pushed
the
fix-56738-oracle-number-scale
branch
from
August 6, 2026 16:45
d9c3da4 to
531c246
Compare
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.
Bare NUMBER columns in Oracle report via JDBC with precision 0 and scale -127,
which Spark previously hardcoded to DecimalType(38, 10). This causes silent
precision loss for any value with more than 10 fractional digits, and there's
no way for users to override it without modifying Spark itself.
Made the fallback scale configurable via spark.sql.jdbc.oracle.numberDefaultScale
(default 10 for backward compatibility). Also added an oracle.numberDefaultScale
JDBC option so individual read() calls can override it without touching the conf.
Added a warning log when the fallback kicks in so users know precision might be lost.
Two test cases added to JDBCSuite: one for the conf override, one for JDBC option
parsing and validation. All existing tests pass. Rebased against upstream/master.