-
Notifications
You must be signed in to change notification settings - Fork 28.6k
[SPARK-31892][SQL][FOLLOWUP][test-java11] Improve test coverage for datetime pattern with formatter functions #28718
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
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7e59d65
[SPARK-31892][SQL][FOLLOWUP] Improve test coverage for valid pattern …
yaooqinn 6449e08
add case
yaooqinn de63621
remove default value
yaooqinn 3fea4de
better look
yaooqinn 34aef79
refine
yaooqinn 47d7322
Merge branch 'master' into SPARK-31892-F
yaooqinn 1e78a4e
fix tests
yaooqinn 83499a1
new tests
yaooqinn 4d34f44
update test
yaooqinn 11c9653
address comments
yaooqinn eeceba5
style
yaooqinn 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
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
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
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
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
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
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
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
36 changes: 36 additions & 0 deletions
36
sql/core/src/test/resources/sql-tests/inputs/datetime-formatting-invalid.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,36 @@ | ||
--- TESTS FOR DATETIME FORMATTING FUNCTIONS WITH INVALID PATTERNS --- | ||
|
||
-- separating this from datetime-formatting.sql, because the text form | ||
-- for patterns with 5 letters in SimpleDateFormat varies from different JDKs | ||
select date_format('2018-11-17 13:33:33.333', 'GGGGG'); | ||
-- pattern letter count can not be greater than 10 | ||
select date_format('2018-11-17 13:33:33.333', 'yyyyyyyyyyy'); | ||
select date_format('2018-11-17 13:33:33.333', 'YYYYYYYYYYY'); | ||
-- q/L in JDK 8 will fail when the count is more than 2 | ||
select date_format('2018-11-17 13:33:33.333', 'qqqqq'); | ||
select date_format('2018-11-17 13:33:33.333', 'QQQQQ'); | ||
select date_format('2018-11-17 13:33:33.333', 'MMMMM'); | ||
select date_format('2018-11-17 13:33:33.333', 'LLLLL'); | ||
select date_format('2018-11-17 13:33:33.333', 'www'); | ||
select date_format('2018-11-17 13:33:33.333', 'WW'); | ||
select date_format('2018-11-17 13:33:33.333', 'uuuuu'); | ||
select date_format('2018-11-17 13:33:33.333', 'EEEEE'); | ||
select date_format('2018-11-17 13:33:33.333', 'FF'); | ||
select date_format('2018-11-17 13:33:33.333', 'ddd'); | ||
-- DD is invalid if the day-of-year exceeds 100, but it becomes valid in Java 11 | ||
-- select date_format('2018-11-17 13:33:33.333', 'DD'); | ||
select date_format('2018-11-17 13:33:33.333', 'DDDD'); | ||
select date_format('2018-11-17 13:33:33.333', 'HHH'); | ||
select date_format('2018-11-17 13:33:33.333', 'hhh'); | ||
select date_format('2018-11-17 13:33:33.333', 'kkk'); | ||
select date_format('2018-11-17 13:33:33.333', 'KKK'); | ||
select date_format('2018-11-17 13:33:33.333', 'mmm'); | ||
select date_format('2018-11-17 13:33:33.333', 'sss'); | ||
select date_format('2018-11-17 13:33:33.333', 'SSSSSSSSSS'); | ||
select date_format('2018-11-17 13:33:33.333', 'aa'); | ||
select date_format('2018-11-17 13:33:33.333', 'V'); | ||
select date_format('2018-11-17 13:33:33.333', 'zzzzz'); | ||
select date_format('2018-11-17 13:33:33.333', 'XXXXXX'); | ||
select date_format('2018-11-17 13:33:33.333', 'ZZZZZZ'); | ||
select date_format('2018-11-17 13:33:33.333', 'OO'); | ||
select date_format('2018-11-17 13:33:33.333', 'xxxxxx'); |
2 changes: 2 additions & 0 deletions
2
sql/core/src/test/resources/sql-tests/inputs/datetime-formatting-legacy.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=LEGACY | ||
--IMPORT datetime-formatting.sql |
Oops, something went wrong.
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.