-
Notifications
You must be signed in to change notification settings - Fork 28.1k
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
[SPARK-8362][SQL] Add unit tests for +, -, *, /, % #6813
Conversation
cc @davies We really need to add unit test for all supported data types for each expression. |
Test build #34880 has finished for PR 6813 at commit
|
* @param testFunc a test function that accepts a conversion function to convert an integer | ||
* into another data type. | ||
*/ | ||
private def testNumericDataTypes(testFunc: (Int => Any) => Unit): Unit = { |
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.
This is really nice.
Merging to master! |
@rxin Sorry for so many bugs, it's surprise to know that almost no tests for DecimalType. |
defineCodeGen(ctx, ev, (eval1, eval2) => | ||
s"(${ctx.javaType(dataType)})($eval1 $symbol $eval2)") | ||
defineCodeGen(ctx, ev, | ||
(eval1, eval2) => s"(${ctx.javaType(dataType)})($eval1 $symbol $eval2)") |
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 do the same thing(only do type cast for short and byte) for other expressions like UnaryMinus
, Divide
, etc.?
Added unit tests for all supported data types for: - Add - Subtract - Multiply - Divide - UnaryMinus - Remainder Fixed bugs caught by the unit tests. Author: Reynold Xin <rxin@databricks.com> Closes apache#6813 from rxin/SPARK-8362 and squashes the following commits: fb3fe62 [Reynold Xin] Added Remainder. 3b266ba [Reynold Xin] [SPARK-8362] Add unit tests for +, -, *, /.
Added unit tests for all supported data types for:
Fixed bugs caught by the unit tests.