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-28312][SQL][TEST] Port numeric.sql #25092

Closed
wants to merge 7 commits into from
Closed

[SPARK-28312][SQL][TEST] Port numeric.sql #25092

wants to merge 7 commits into from

Conversation

wangyum
Copy link
Member

@wangyum wangyum commented Jul 10, 2019

What changes were proposed in this pull request?

This PR is to port numeric.sql from PostgreSQL regression tests. https://github.com/postgres/postgres/blob/REL_12_BETA2/src/test/regress/sql/numeric.sql

The expected results can be found in the link: https://github.com/postgres/postgres/blob/REL_12_BETA2/src/test/regress/expected/numeric.out

When porting the test cases, found four PostgreSQL specific features that do not exist in Spark SQL:
SPARK-28315: Decimal can not accept NaN as input
SPARK-28317: Built-in Mathematical Functions: SCALE
SPARK-28318: Decimal can only support precision up to 38
SPARK-28322: DIV support decimal type

Also, found four inconsistent behavior:
SPARK-28316: Decimal precision issue
SPARK-28324: The LOG function using 10 as the base, but Spark using E
SPARK-27923: Spark SQL insert bad inputs to NULL
SPARK-28007: Caret operator (^) means bitwise XOR in Spark/Hive and exponentiation in Postgres

How was this patch tested?

N/A

@SparkQA
Copy link

SparkQA commented Jul 10, 2019

Test build #107439 has finished for PR 25092 at commit 60d3e65.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@wangyum
Copy link
Member Author

wangyum commented Jul 10, 2019

retest this please

@SparkQA
Copy link

SparkQA commented Jul 10, 2019

Test build #107443 has finished for PR 25092 at commit 60d3e65.

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

--
--
-- NUMERIC
-- https://github.com/postgres/postgres/blob/REL_12_BETA1/src/test/regress/sql/numeric.sql
Copy link
Member

Choose a reason for hiding this comment

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

REL_12_BETA2 according to the PR description?

--
-- This test suite contains eight Cartesian products without using explicit CROSS JOIN syntax.
-- Thus, we set spark.sql.crossJoin.enabled to true.
set spark.sql.crossJoin.enabled=true;
Copy link
Member

Choose a reason for hiding this comment

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

PostgreSQL accepts cartesian joins by default. So, if the other ported tests include these joins, I think better to move this option into SQLQueryTestSuite to accept them for these PostgreSQL tests?

@SparkQA
Copy link

SparkQA commented Jul 11, 2019

Test build #107492 has finished for PR 25092 at commit afb7a4f.

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

@SparkQA
Copy link

SparkQA commented Jul 14, 2019

Test build #107641 has finished for PR 25092 at commit 07e2b22.

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

@SparkQA
Copy link

SparkQA commented Jul 15, 2019

Test build #107664 has finished for PR 25092 at commit bc11e02.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jul 15, 2019

Test build #107669 has finished for PR 25092 at commit 02d40e0.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class Division(conf: SQLConf) extends TypeCoercionRule

@SparkQA
Copy link

SparkQA commented Jul 15, 2019

Test build #107670 has finished for PR 25092 at commit e146292.

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

@dongjoon-hyun
Copy link
Member

Retest this please.

@SparkQA
Copy link

SparkQA commented Jul 18, 2019

Test build #107805 has finished for PR 25092 at commit e146292.

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

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM. Thank you, @wangyum .

This is a little more verbose than PostgreSQL output file because Spark's INSERT INTO output takes almost 3700 lines. And, there is an on-going PR, but I'd like to merge this first because they seems to take more time.

Merged to master.

@wangyum wangyum deleted the SPARK-28312 branch July 18, 2019 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants