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

[SPARK-8362][SQL] Add unit tests for +, -, *, /, % #6813

Closed
wants to merge 2 commits into from

Conversation

rxin
Copy link
Contributor

@rxin rxin commented Jun 14, 2015

Added unit tests for all supported data types for:

  • Add
  • Subtract
  • Multiply
  • Divide
  • UnaryMinus
  • Remainder

Fixed bugs caught by the unit tests.

@rxin
Copy link
Contributor Author

rxin commented Jun 14, 2015

cc @davies

We really need to add unit test for all supported data types for each expression.

@rxin rxin changed the title [SPARK-8362] Add unit tests for +, -, *, /, % [SPARK-8362][SQL] Add unit tests for +, -, *, /, % Jun 14, 2015
@SparkQA
Copy link

SparkQA commented Jun 14, 2015

Test build #34880 has finished for PR 6813 at commit fb3fe62.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

* @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 = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really nice.

@marmbrus
Copy link
Contributor

Merging to master!

@asfgit asfgit closed this in 53c16b9 Jun 14, 2015
@davies
Copy link
Contributor

davies commented Jun 14, 2015

@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)")
Copy link
Contributor

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.?

nemccarthy pushed a commit to nemccarthy/spark that referenced this pull request Jun 19, 2015
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 +, -, *, /.
asfgit pushed a commit that referenced this pull request Jun 24, 2015
a follow up of #6813

Author: Wenchen Fan <cloud0fan@outlook.com>

Closes #6825 from cloud-fan/cg and squashes the following commits:

43170cc [Wenchen Fan] fix bugs in code gen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants