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-42921][SQL][TESTS] Split timestampNTZ/datetime-special.sql into w/ and w/o ansi suffix to pass sql analyzer test in ansi mode #40552

Closed
wants to merge 5 commits into from

Conversation

LuciferYang
Copy link
Contributor

@LuciferYang LuciferYang commented Mar 25, 2023

What changes were proposed in this pull request?

After #40496, run

SPARK_ANSI_SQL_MODE=true build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite"

There is one test faild with spark.sql.ansi.enabled = true

[info] - timestampNTZ/datetime-special.sql_analyzer_test *** FAILED *** (11 milliseconds)
[info]   timestampNTZ/datetime-special.sql_analyzer_test
[info]   Expected "...date(999999, 3, 18, [false) AS make_date(999999, 3, 18)#x, make_date(-1, 1, 28, fals]e) AS make_date(-1, ...", but got "...date(999999, 3, 18, [true) AS make_date(999999, 3, 18)#x, make_date(-1, 1, 28, tru]e) AS make_date(-1, ..." Result did not match for query #1
[info]   select make_date(999999, 3, 18), make_date(-1, 1, 28) (SQLQueryTestSuite.scala:777)
[info]   org.scalatest.exceptions.TestFailedException:

The failure reason is the last parameter of function MakeDate is failOnError: Boolean = SQLConf.get.ansiEnabled.

So this pr split timestampNTZ/datetime-special.sql into w/ and w/o ansi to mask this test difference.

Why are the changes needed?

Make SQLQueryTestSuite test pass with spark.sql.ansi.enabled = true.

Does this PR introduce any user-facing change?

No

How was this patch tested?

  • Pass GitHub Actions
  • Manual checked SPARK_ANSI_SQL_MODE=true build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite"

@github-actions github-actions bot added the SQL label Mar 25, 2023
@LuciferYang LuciferYang changed the title [SPARK-42921][SQL][TESTS] Split timestampNTZ/datetime-special.sql into w/ and w/o ansi for test [SPARK-42921][SQL][TESTS] Split timestampNTZ/datetime-special.sql into w/ and w/o ansi for fix sql analyzer test Mar 25, 2023
@LuciferYang
Copy link
Contributor Author

cc @dtenedor @HyukjinKwon FYI

@LuciferYang LuciferYang changed the title [SPARK-42921][SQL][TESTS] Split timestampNTZ/datetime-special.sql into w/ and w/o ansi for fix sql analyzer test [SPARK-42921][SQL][TESTS] Split timestampNTZ/datetime-special.sql into w/ and w/o ansi suffix to fix sql analyzer test Mar 25, 2023
@LuciferYang LuciferYang changed the title [SPARK-42921][SQL][TESTS] Split timestampNTZ/datetime-special.sql into w/ and w/o ansi suffix to fix sql analyzer test [SPARK-42921][SQL][TESTS] Split timestampNTZ/datetime-special.sql into w/ and w/o ansi suffix to pass sql analyzer test Mar 25, 2023
@LuciferYang LuciferYang changed the title [SPARK-42921][SQL][TESTS] Split timestampNTZ/datetime-special.sql into w/ and w/o ansi suffix to pass sql analyzer test [SPARK-42921][SQL][TESTS] Split timestampNTZ/datetime-special.sql into w/ and w/o ansi suffix to pass sql analyzer test in ansi mode Mar 25, 2023
@dtenedor
Copy link
Contributor

I am so sorry to break the build again :| thanks for fixing it! It looks like we need separate regular and ANSI test cases now!

@@ -88,6 +88,8 @@ class ThriftServerQueryTestSuite extends SQLQueryTestSuite with SharedThriftServ
"datetime-special.sql",
"ansi/datetime-special.sql",
"timestampNTZ/datetime-special.sql",
// SPARK-42921
"timestampNTZ/datetime-special-ansi.sql",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ignore in ThriftServerQueryTestSuite, same reason as timestampNTZ/datetime-special.sql

@HyukjinKwon
Copy link
Member

Merged to master.

@LuciferYang
Copy link
Contributor Author

Thanks @HyukjinKwon @dtenedor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants