Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Stop everything being decimals #27

Closed
RobinL opened this issue Jan 8, 2020 · 0 comments · Fixed by #41
Closed

Stop everything being decimals #27

RobinL opened this issue Jan 8, 2020 · 0 comments · Fixed by #41

Comments

@RobinL
Copy link
Member

RobinL commented Jan 8, 2020

Spark treats literal values in queries as decimals

i.e. in the following a is a decimal:

spark.sql("select 0.2/0.3 as a")

See here

We need to refactor a bunch of statement to wrap them with cast:
spark.sql("select cast(0.2 as float)/cast(0.3 as float) as a")

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 a pull request may close this issue.

1 participant