Uh oh!
There was an error while loading. Please reload this page.
[SPARK-27008][SQL] Support java.time.LocalDate as an external type of DateType - #23913
Closed
MaxGekk wants to merge 9 commits into
Closed
[SPARK-27008][SQL] Support java.time.LocalDate as an external type of DateType#23913MaxGekk wants to merge 9 commits into
MaxGekk wants to merge 9 commits into
Conversation
HeartSaVioR
commented
Feb 27, 2019
Contributor
MaxGekk
commented
Feb 27, 2019
MemberAuthor
@HeartSaVioR I see, I will rebase. |
HeartSaVioR
commented
Feb 27, 2019
Contributor
Yeah if your patch gets in first I'll apply the change too. Thanks! |
SparkQA
commented
Feb 28, 2019
Test build #102835 has finished for PR 23913 at commit
|
MaxGekk
commented
Feb 28, 2019
MemberAuthor
@cloud-fan@HeartSaVioR Please, review the PR. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
cloud-fan
commented
Feb 28, 2019
Contributor
LGTM |
SparkQA
commented
Feb 28, 2019
Test build #102862 has finished for PR 23913 at commit
|
SparkQA
commented
Feb 28, 2019
Test build #102859 has finished for PR 23913 at commit
|
MaxGekk
commented
Feb 28, 2019
MemberAuthor
jenkins, retest this, please |
SparkQA
commented
Feb 28, 2019
Test build #102870 has finished for PR 23913 at commit
|
cloud-fan
commented
Mar 1, 2019
Contributor
thanks, merging to master! |
HyukjinKwon
commented
Mar 5, 2019
Member
Nice, +1! |
cloud-fan pushed a commit
that referenced
this pull request
Mar 21, 2019
## What changes were proposed in this pull request? In the PR, I propose to extend `Literal.apply` to support constructing literals of `TimestampType` and `DateType` from `java.time.Instant` and `java.time.LocalDate`. The java classes have been already supported as external types for `TimestampType` and `DateType` by the PRs #23811 and #23913. ## How was this patch tested? Added new tests to `LiteralExpressionSuite`. Closes#24161 from MaxGekk/literal-instant-localdate. Authored-by: Maxim Gekk <maxim.gekk@databricks.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
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
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changes were proposed in this pull request?
In the PR, I propose to add new Catalyst type converter for
DateType. It should be able to convertjava.time.LocalDateto/fromDateType.Main motivations for the changes:
java.sql.Date(hybrid calendar - Julian + Gregorian).By default, Spark converts values of
DateTypetojava.sql.Dateinstances but the SQL configspark.sql.datetime.java8API.enabledcan change the behavior. If it is set totrue, Spark usesjava.time.LocalDateas external type forDateType.How was this patch tested?
Added new testes to
CatalystTypeConvertersSuiteto check conversion ofDateTypeto/fromjava.time.LocalDate,JavaUDFSuite/UDFSuiteto test usage ofLocalDatetype in Scala/Java UDFs.