Skip to content

[SPARK-56738][SQL] Make Oracle bare NUMBER default scale configurable - #57795

Open
ruchi-mish90 wants to merge 5 commits into
apache:masterfrom
ruchi-mish90:fix-56738-oracle-number-scale
Open

[SPARK-56738][SQL] Make Oracle bare NUMBER default scale configurable#57795
ruchi-mish90 wants to merge 5 commits into
apache:masterfrom
ruchi-mish90:fix-56738-oracle-number-scale

Conversation

@ruchi-mish90

Copy link
Copy Markdown

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.

@ruchi-mish90
ruchi-mish90 force-pushed the fix-56738-oracle-number-scale branch from 8483c31 to d9c3da4 Compare August 6, 2026 14:44
@ruchi-mish90
ruchi-mish90 force-pushed the fix-56738-oracle-number-scale branch from d9c3da4 to 531c246 Compare August 6, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant