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
Conversation
Test build #107439 has finished for PR 25092 at commit
|
retest this please |
Test build #107443 has finished for PR 25092 at commit
|
-- | ||
-- | ||
-- NUMERIC | ||
-- https://github.com/postgres/postgres/blob/REL_12_BETA1/src/test/regress/sql/numeric.sql |
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.
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; |
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.
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?
Test build #107492 has finished for PR 25092 at commit
|
Test build #107641 has finished for PR 25092 at commit
|
Test build #107664 has finished for PR 25092 at commit
|
Test build #107669 has finished for PR 25092 at commit
|
Test build #107670 has finished for PR 25092 at commit
|
Retest this please. |
Test build #107805 has finished for PR 25092 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.
+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.
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 inputSPARK-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