Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Audit][SPARK-39749][SQL] Always use plain string representation on casting Decimal to String #6015

Open
amahussein opened this issue Jul 19, 2022 · 0 comments
Labels
audit_3.4.0 Audit related tasks for 3.4.0

Comments

@amahussein
Copy link
Collaborator

amahussein commented Jul 19, 2022

Is your feature request related to a problem? Please describe.
Currently in Spark, casting decimal as string type will result in Strings with exponential notations if the adjusted exponent is less than -6. This is consistent with BigDecimal.toString https://docs.oracle.com/javase/8/docs/api/java/math/BigDecimal.html#toString

After this issue got merged, the casting always uses plain string representation.
To restore the legacy behavior, which uses scientific notation if the adjusted exponent is less than -6, set spark.sql.legacy.castDecimalToString.enabled to true.

Describe the solution you'd like
We need to revisit the cast tests, documentation, and the description of the RAPIDS configuration.

Additional context
apache/spark@c621df269d

EDIT

A followup issue was created for spark-3.4
[SPARK-39749][SQL][FOLLOWUP] Move the new behavior of CAST(DECIMAL AS STRING) under ANSI SQL mode
apache/spark@5bd47640dc

@amahussein amahussein added feature request New feature or request ? - Needs Triage Need team to review and classify audit_3.4.0 Audit related tasks for 3.4.0 labels Jul 19, 2022
@sameerz sameerz added P1 Nice to have for release and removed feature request New feature or request ? - Needs Triage Need team to review and classify labels Jul 19, 2022
@mattahrens mattahrens removed the P1 Nice to have for release label Aug 7, 2023
@nartal1 nartal1 mentioned this issue Sep 7, 2023
50 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
audit_3.4.0 Audit related tasks for 3.4.0
Projects
None yet
Development

No branches or pull requests

3 participants