-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-9281] [SQL] use decimal or double when parsing SQL #7642
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
Conversation
|
Test build #38337 has finished for PR 7642 at commit
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo 'e?
|
Test build #1197 has finished for PR 7642 at commit
|
|
Test build #38379 has finished for PR 7642 at commit
|
|
Test build #38384 has finished for PR 7642 at commit
|
Conflicts: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisSuite.scala
|
Test build #38679 has finished for PR 7642 at commit
|
|
We should add "releasenotes" label to the JIRA ticket. |
|
cc @cloud-fan for review too |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we apply this to CreateArray too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For CreateArray, it's good to make it strict. We can loose the rule later.
|
LGTM |
|
@davies do we need to change the hive ql part? |
|
@rxin HiveQl already does this, it always parse float number as decimal. |
|
Great - merging this in. Thanks. |
|
hi @davies seems this is not compatible with hiveql, HiveQl still parse float number as double. https://github.com/apache/spark/blob/master/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala#L1670-L1689 Or i missed sth? |
|
Yes, If you use HiveContext, you will be compatible with Hive, but SQLContext will not. |
Right now, we use double to parse all the float number in SQL. When it's used in expression together with DecimalType, it will turn the decimal into double as well. Also it will loss some precision when using double.
This PR change to parse float number to decimal or double, based on it's using scientific notation or not, see https://msdn.microsoft.com/en-us/library/ms179899.aspx
This is a break change, should we doc it somewhere?