-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-8363][SQL] Move sqrt to math and extend UnaryMathExpression #6823
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 #34917 has finished for PR 6823 at commit
|
|
Test build #34919 has finished for PR 6823 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.
I think we need to move this test case from arithmetic cases to math test cases.
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.
math test cases already have similar tests. If we don't need it here, we can remove it from arithmetic cases.
|
Test build #34921 has finished for PR 6823 at commit
|
…est. Remove unnecessary Sqrt type rule.
|
Test build #34939 has finished for PR 6823 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.
isn't 2^24 super large? why are we doing this in a unit test?
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.
They are moved from the test of sqrt in ArithmeticExpressionSuite. Is it better to directly remove them?
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.
I think we can just pick a few numbers out of that. There isn't much benefit to test a lot of numbers here.
Conflicts: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala
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.
Ah, I think this should be 1.5.0 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.
sorry what I meant was writing out the sqrt value explicitly ... rather than relying on some sequence
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.
ok. sorry I misunderstand that.
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.
actually - question: why having this when you already have the testUnary call up there?
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.
maybe this is doing something I am not understanding yet
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.
They are old tests in ArithmeticExpressionSuite. I think we can remove them.
|
Test build #35111 has finished for PR 6823 at commit
|
|
Test build #35102 has finished for PR 6823 at commit
|
|
Test build #35103 has finished for PR 6823 at commit
|
|
Test build #35106 has finished for PR 6823 at commit
|
|
LGTM |
|
Thanks. Merging this. |
|
Can you add the Python version for this? |
JIRA: https://issues.apache.org/jira/browse/SPARK-8363 Author: Liang-Chi Hsieh <[email protected]> Closes apache#6823 from viirya/move_sqrt and squashes the following commits: 8977e11 [Liang-Chi Hsieh] Remove unnecessary old tests. d23e79e [Liang-Chi Hsieh] Explicitly indicate sqrt value sequence. 699f48b [Liang-Chi Hsieh] Use correct @SInCE tag. 8dff6d1 [Liang-Chi Hsieh] Merge remote-tracking branch 'upstream/master' into move_sqrt bc2ed77 [Liang-Chi Hsieh] Remove/move arithmetic expression test and expression type checking test. Remove unnecessary Sqrt type rule. d38492f [Liang-Chi Hsieh] Now sqrt accepts boolean because type casting is handled by HiveTypeCoercion. 297cc90 [Liang-Chi Hsieh] Sqrt only accepts double input. ef4a21a [Liang-Chi Hsieh] Move sqrt to math.
JIRA: https://issues.apache.org/jira/browse/SPARK-8363