Uh oh!
There was an error while loading. Please reload this page.
[SPARK-36970][SQL] Manual disabled format B of date_format function to make Java 17 compatible with Java 8 - #34237
[SPARK-36970][SQL] Manual disabled format B of date_format function to make Java 17 compatible with Java 8#34237LuciferYang wants to merge 7 commits into
B of date_format function to make Java 17 compatible with Java 8#34237Conversation
LuciferYang
commented
Oct 11, 2021
SparkQA
commented
Oct 11, 2021
Kubernetes integration test starting |
SparkQA
commented
Oct 11, 2021
Kubernetes integration test status failure |
| // 2.4, the SimpleDateFormat uses Monday as the first day of week. | ||
| final val weekBasedLetters = Set('Y', 'W', 'w', 'u', 'e', 'c') | ||
| final val unsupportedLetters = Set('A', 'n', 'N', 'p') | ||
| final val unknownPatternLetters: Set[Char] = Set('B') |
There was a problem hiding this comment.
What's the difference between unsupported and unknown letters from your point of view?
There was a problem hiding this comment.
@MaxGekk Both unsupportedLetters and unknownPatternLetters are used for explicitly banned some pattern letters and throw IllegalArgumentException
The only difference is the content of the error message, throw IllegalArgumentException with Unknown pattern letter: $c Is the current behavior.
If we accept the change of error message content, we can reuse unsupportedLetters.
There was a problem hiding this comment.
If we accept the change of error message content ...
I think it is ok. Let's put 'B' to unsupportedLetters. BTW, should we standardise the exception by following https://issues.apache.org/jira/browse/SPARK-33539, cc @allisonwang-db ?
SparkQA
commented
Oct 11, 2021
Kubernetes integration test starting |
SparkQA
commented
Oct 11, 2021
Kubernetes integration test status failure |
SparkQA
commented
Oct 11, 2021
Test build #144066 has finished for PR 34237 at commit
|
SparkQA
commented
Oct 11, 2021
Kubernetes integration test starting |
SparkQA
commented
Oct 11, 2021
Kubernetes integration test status failure |
SparkQA
commented
Oct 11, 2021
Test build #144072 has finished for PR 34237 at commit
|
SparkQA
commented
Oct 11, 2021
Test build #144078 has finished for PR 34237 at commit
|
dongjoon-hyun
left a comment
There was a problem hiding this comment.
+1, LGTM. Thank you, @LuciferYang , @srowen , @MaxGekk .
Merged to master for Apache Spark 3.3.
dongjoon-hyun
commented
Oct 11, 2021
Oh, I'm taking my words back. It seems that there is a TPCDS test failure still. |
dongjoon-hyun
commented
Oct 11, 2021
Could you re-trigger GitHub Action once more, @LuciferYang ? |
LuciferYang
commented
Oct 12, 2021
OK, the exit code is 137. It looks like it was killed |
LuciferYang
commented
Oct 12, 2021
@dongjoon-hyun |
MaxGekk
commented
Oct 12, 2021
@LuciferYang Could you re-trigger GAs via an empty commit: |
SparkQA
commented
Oct 12, 2021
Test build #144143 has finished for PR 34237 at commit
|
SparkQA
commented
Oct 12, 2021
Kubernetes integration test starting |
SparkQA
commented
Oct 12, 2021
Kubernetes integration test status failure |
SparkQA
commented
Oct 12, 2021
Kubernetes integration test starting |
SparkQA
commented
Oct 12, 2021
Kubernetes integration test starting |
SparkQA
commented
Oct 12, 2021
Kubernetes integration test status failure |
SparkQA
commented
Oct 12, 2021
Kubernetes integration test status failure |
LuciferYang
commented
Oct 12, 2021
Already re-trigger GAs many times,it seems that I need to investigate the reasons for the failure of hive SlowTest |
SparkQA
commented
Oct 12, 2021
Test build #144152 has finished for PR 34237 at commit
|
MaxGekk
commented
Oct 12, 2021
+1, LGTM. Merging to master. All GAs passed |
dongjoon-hyun
commented
Oct 12, 2021
Thank you all. :) |
LuciferYang
commented
Oct 13, 2021
thank all ~ |


What changes were proposed in this pull request?
The
date_formatfunction withBformat has different behavior when use Java 8 and Java 17,select date_format('2018-11-17 13:33:33.333', 'B')indatetime-formatting-invalid.sqlcan prove this.The case result with Java 8 is
and the case result with Java 17 is
We found that this is due to the new support of format
Bin Java 17And through http://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html , we can confirm that format
Bis not documented/supported fordate_formatfunction currently.So the main change of this pr is manual disabled format
Bofdate_formatfunction inDateTimeFormatterHelperto make Java 17 compatible with Java 8.Why are the changes needed?
Ensure that Java 17 and Java 8 have the same behavior.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
SQLQueryTestSuitewith JDK 17Before
After
The test
select date_format('2018-11-17 13:33:33.333', 'B')indatetime-formatting-invalid.sqlpassed