-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-47719][SQL] Change spark.sql.legacy.timeParserPolicy default to CORRECTED #45859
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
Closed
srielau
wants to merge
9
commits into
apache:master
from
srielau:SPARK-47719-parser-policy-default-to-corrected
Closed
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9fdf8df
[SPARK-47719] LEGACY_TIME_PARSER_POLICY_KEY default to CORRECTED
srielau 8c51461
Add files
srielau ed0d9e2
Fix test mismatches,address comments
srielau 33e81f0
Fix DefaultSqlApiConf
srielau 7037125
Remove unneded new tests, fix other tests, fix docs
srielau 8b786fe
Update DatetimeFormatterSuite.scala
cloud-fan e78e5eb
Fix scala style and another testcase
srielau 8fba689
Merge branch 'SPARK-47719-parser-policy-default-to-corrected' of http…
srielau 0792f3e
Fix spark connect testcase
srielau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
[SPARK-47719] LEGACY_TIME_PARSER_POLICY_KEY default to CORRECTED
- Loading branch information
commit 9fdf8df25beef3bde460e5aa16fd16dc02c419b6
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
sql/core/src/test/resources/sql-tests/inputs/datetime-exception.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| --SET spark.sql.legacy.timeParserPolicy=EXCEPTION | ||
| --IMPORT date.sql | ||
| --IMPORT timestamp.sql |
2 changes: 2 additions & 0 deletions
2
sql/core/src/test/resources/sql-tests/inputs/datetime-formatting-exception.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| --SET spark.sql.legacy.timeParserPolicy=EXCEPTION | ||
| --IMPORT datetime-formatting.sql | ||
srielau marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
2 changes: 2 additions & 0 deletions
2
sql/core/src/test/resources/sql-tests/inputs/datetime-parsing-exception.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| --SET spark.sql.legacy.timeParserPolicy=EXCEPTION | ||
| --IMPORT datetime-parsing.sql |
207 changes: 207 additions & 0 deletions
207
sql/core/src/test/resources/sql-tests/results/datetime-parsing-exception.sql.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,207 @@ | ||
| -- Automatically generated by SQLQueryTestSuite | ||
| -- !query | ||
| select to_timestamp('1', 'y') | ||
| -- !query schema | ||
| struct<to_timestamp(1, y):timestamp> | ||
| -- !query output | ||
| 0001-01-01 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('009999', 'y') | ||
| -- !query schema | ||
| struct<to_timestamp(009999, y):timestamp> | ||
| -- !query output | ||
| 9999-01-01 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('00', 'yy') | ||
| -- !query schema | ||
| struct<to_timestamp(00, yy):timestamp> | ||
| -- !query output | ||
| 2000-01-01 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('99', 'yy') | ||
| -- !query schema | ||
| struct<to_timestamp(99, yy):timestamp> | ||
| -- !query output | ||
| 2099-01-01 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('001', 'yyy') | ||
| -- !query schema | ||
| struct<to_timestamp(001, yyy):timestamp> | ||
| -- !query output | ||
| 0001-01-01 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('009999', 'yyy') | ||
| -- !query schema | ||
| struct<to_timestamp(009999, yyy):timestamp> | ||
| -- !query output | ||
| 9999-01-01 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('0001', 'yyyy') | ||
| -- !query schema | ||
| struct<to_timestamp(0001, yyyy):timestamp> | ||
| -- !query output | ||
| 0001-01-01 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('9999', 'yyyy') | ||
| -- !query schema | ||
| struct<to_timestamp(9999, yyyy):timestamp> | ||
| -- !query output | ||
| 9999-01-01 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('00001', 'yyyyy') | ||
| -- !query schema | ||
| struct<to_timestamp(00001, yyyyy):timestamp> | ||
| -- !query output | ||
| 0001-01-01 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('09999', 'yyyyy') | ||
| -- !query schema | ||
| struct<to_timestamp(09999, yyyyy):timestamp> | ||
| -- !query output | ||
| 9999-01-01 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('000001', 'yyyyyy') | ||
| -- !query schema | ||
| struct<to_timestamp(000001, yyyyyy):timestamp> | ||
| -- !query output | ||
| 0001-01-01 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('009999', 'yyyyyy') | ||
| -- !query schema | ||
| struct<to_timestamp(009999, yyyyyy):timestamp> | ||
| -- !query output | ||
| 9999-01-01 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('9', 'D') | ||
| -- !query schema | ||
| struct<to_timestamp(9, D):timestamp> | ||
| -- !query output | ||
| 1970-01-09 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('300', 'D') | ||
| -- !query schema | ||
| struct<to_timestamp(300, D):timestamp> | ||
| -- !query output | ||
| 1970-10-27 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('09', 'DD') | ||
| -- !query schema | ||
| struct<to_timestamp(09, DD):timestamp> | ||
| -- !query output | ||
| 1970-01-09 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('99', 'DD') | ||
| -- !query schema | ||
| struct<to_timestamp(99, DD):timestamp> | ||
| -- !query output | ||
| 1970-04-09 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('100', 'DD') | ||
| -- !query schema | ||
| struct<to_timestamp(100, DD):timestamp> | ||
| -- !query output | ||
| 1970-04-10 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('009', 'DDD') | ||
| -- !query schema | ||
| struct<to_timestamp(009, DDD):timestamp> | ||
| -- !query output | ||
| 1970-01-09 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('365', 'DDD') | ||
| -- !query schema | ||
| struct<to_timestamp(365, DDD):timestamp> | ||
| -- !query output | ||
| 1970-12-31 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('31-365', 'dd-DDD') | ||
| -- !query schema | ||
| struct<to_timestamp(31-365, dd-DDD):timestamp> | ||
| -- !query output | ||
| 1970-12-31 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('12-365', 'MM-DDD') | ||
| -- !query schema | ||
| struct<to_timestamp(12-365, MM-DDD):timestamp> | ||
| -- !query output | ||
| 1970-12-31 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('2020-365', 'yyyy-DDD') | ||
| -- !query schema | ||
| struct<to_timestamp(2020-365, yyyy-DDD):timestamp> | ||
| -- !query output | ||
| 2020-12-30 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('12-31-365', 'MM-dd-DDD') | ||
| -- !query schema | ||
| struct<to_timestamp(12-31-365, MM-dd-DDD):timestamp> | ||
| -- !query output | ||
| 1970-12-31 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('2020-30-365', 'yyyy-dd-DDD') | ||
| -- !query schema | ||
| struct<to_timestamp(2020-30-365, yyyy-dd-DDD):timestamp> | ||
| -- !query output | ||
| 2020-12-30 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('2020-12-350', 'yyyy-MM-DDD') | ||
| -- !query schema | ||
| struct<to_timestamp(2020-12-350, yyyy-MM-DDD):timestamp> | ||
| -- !query output | ||
| 2020-12-15 00:00:00 | ||
|
|
||
|
|
||
| -- !query | ||
| select to_timestamp('2020-12-31-366', 'yyyy-MM-dd-DDD') | ||
| -- !query schema | ||
| struct<to_timestamp(2020-12-31-366, yyyy-MM-dd-DDD):timestamp> | ||
| -- !query output | ||
| 2020-12-31 00:00:00 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.