- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 12:24 PM - edited 01-29-2025 12:37 PM
Hey @filipniziol,
Thank you so much for your response and the code snipped you provided! You are right - it should not be possible that this number is inside of this DataFrame! The problem seems to be the Spark JDBC connector. The data source is a Oracle Database. The column in question is of type float with a scale of 127 and a prescision of 126.
However Spark translates this column directly to a Decimal(38, 10) Type and automatically infers this from the source. Once it wants to cast the type, apparently it fails due to the number oviously being too large for the type it is supposed to be.
I have found out, that this float type is stored in the database as type "number" (Data Types). So it is apparently default behavior for Spark to translate this into a Decimal(38,10) (Solved: Re: Spark error - Decimal precision exceeds max pr... - Cloudera Community - 392840).
Sadly this info doesnt really help to solve my problem - Im just unable to change it to anything else. Maybe there is an option t
Best regards
Samuel