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
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
-- Automatically generated by SQLQueryTestSuite
-- !query
select date'999999-03-18', date'-0001-1-28', date'0015'
-- !query analysis
[Analyzer test output redacted due to nondeterminism]


-- !query
select make_date(999999, 3, 18), make_date(-1, 1, 28)
-- !query analysis
Project [make_date(999999, 3, 18, true) AS make_date(999999, 3, 18)#x, make_date(-1, 1, 28, true) AS make_date(-1, 1, 28)#x]
+- OneRowRelation


-- !query
select timestamp'-1969-12-31 16:00:00', timestamp'-0015-03-18 16:00:00', timestamp'-000001', timestamp'99999-03-18T12:03:17'
-- !query analysis
Project [-1969-12-31 16:00:00 AS TIMESTAMP_NTZ '-1969-12-31 16:00:00'#x, -0015-03-18 16:00:00 AS TIMESTAMP_NTZ '-0015-03-18 16:00:00'#x, -0001-01-01 00:00:00 AS TIMESTAMP_NTZ '-0001-01-01 00:00:00'#x, +99999-03-18 12:03:17 AS TIMESTAMP_NTZ '+99999-03-18 12:03:17'#x]
+- OneRowRelation


-- !query
select make_timestamp(-1969, 12, 31, 16, 0, 0.0), make_timestamp(-15, 3, 18, 16, 0, 0.0), make_timestamp(99999, 3, 18, 12, 3, 17.0)
-- !query analysis
Project [make_timestamp(-1969, 12, 31, 16, 0, cast(0.0 as decimal(16,6)), None, Some(America/Los_Angeles), true, TimestampNTZType) AS make_timestamp(-1969, 12, 31, 16, 0, 0.0)#x, make_timestamp(-15, 3, 18, 16, 0, cast(0.0 as decimal(16,6)), None, Some(America/Los_Angeles), true, TimestampNTZType) AS make_timestamp(-15, 3, 18, 16, 0, 0.0)#x, make_timestamp(99999, 3, 18, 12, 3, cast(17.0 as decimal(16,6)), None, Some(America/Los_Angeles), true, TimestampNTZType) AS make_timestamp(99999, 3, 18, 12, 3, 17.0)#x]
+- OneRowRelation
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--SET spark.sql.ansi.enabled = true
--IMPORT datetime-special.sql
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
--SET spark.sql.ansi.enabled = false
--IMPORT datetime-special.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
-- Automatically generated by SQLQueryTestSuite
-- !query
select date'999999-03-18', date'-0001-1-28', date'0015'
-- !query schema
struct<DATE '+999999-03-18':date,DATE '-0001-01-28':date,DATE '0015-01-01':date>
-- !query output
+999999-03-18 -0001-01-28 0015-01-01


-- !query
select make_date(999999, 3, 18), make_date(-1, 1, 28)
-- !query schema
struct<make_date(999999, 3, 18):date,make_date(-1, 1, 28):date>
-- !query output
+999999-03-18 -0001-01-28


-- !query
select timestamp'-1969-12-31 16:00:00', timestamp'-0015-03-18 16:00:00', timestamp'-000001', timestamp'99999-03-18T12:03:17'
-- !query schema
struct<TIMESTAMP_NTZ '-1969-12-31 16:00:00':timestamp_ntz,TIMESTAMP_NTZ '-0015-03-18 16:00:00':timestamp_ntz,TIMESTAMP_NTZ '-0001-01-01 00:00:00':timestamp_ntz,TIMESTAMP_NTZ '+99999-03-18 12:03:17':timestamp_ntz>
-- !query output
-1969-12-31 16:00:00 -0015-03-18 16:00:00 -0001-01-01 00:00:00 +99999-03-18 12:03:17


-- !query
select make_timestamp(-1969, 12, 31, 16, 0, 0.0), make_timestamp(-15, 3, 18, 16, 0, 0.0), make_timestamp(99999, 3, 18, 12, 3, 17.0)
-- !query schema
struct<make_timestamp(-1969, 12, 31, 16, 0, 0.0):timestamp_ntz,make_timestamp(-15, 3, 18, 16, 0, 0.0):timestamp_ntz,make_timestamp(99999, 3, 18, 12, 3, 17.0):timestamp_ntz>
-- !query output
-1969-12-31 16:00:00 -0015-03-18 16:00:00 +99999-03-18 12:03:17
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ class ThriftServerQueryTestSuite extends SQLQueryTestSuite with SharedThriftServ
"subquery/in-subquery/in-group-by.sql",
"subquery/in-subquery/simple-in.sql",
"subquery/in-subquery/in-order-by.sql",
"subquery/in-subquery/in-set-operations.sql"
"subquery/in-subquery/in-set-operations.sql",
// SPARK-42921
"timestampNTZ/datetime-special-ansi.sql"
)

override def runQueries(
Expand Down