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-34392][SQL] Support ZoneOffset +h:mm in DateTimeUtils. getZoneId #31624

Closed
wants to merge 10 commits into from

Conversation

Karl-WangSK
Copy link
Contributor

@Karl-WangSK Karl-WangSK commented Feb 23, 2021

What changes were proposed in this pull request?

To support +8:00 in Spark3 when execute sql
select to_utc_timestamp("2020-02-07 16:00:00", "GMT+8:00")

Why are the changes needed?

+8:00 this format is supported in PostgreSQL,hive, presto, but not supported in Spark3
https://issues.apache.org/jira/browse/SPARK-34392

Does this PR introduce any user-facing change?

no

How was this patch tested?

unit test

@maropu
Copy link
Member

maropu commented Feb 24, 2021

ok to test

@maropu
Copy link
Member

maropu commented Feb 24, 2021

cc: @MaxGekk

@maropu
Copy link
Member

maropu commented Feb 24, 2021

Could you make the PR title clearer? Probably, it should be like [SPARK-34392][SQL] Support a new brabra...

@Karl-WangSK Karl-WangSK changed the title [SPARK-34392][SQL] Invalid ID for offset-based ZoneId since Spark 3.0 [SPARK-34392][SQL] To support ZoneOffset +h:mm when get ZoneId in Spark 3.0 Feb 24, 2021
@SparkQA
Copy link

SparkQA commented Feb 24, 2021

Test build #135395 has started for PR 31624 at commit d48a763.

@SparkQA
Copy link

SparkQA commented Feb 24, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39975/

@maropu maropu changed the title [SPARK-34392][SQL] To support ZoneOffset +h:mm when get ZoneId in Spark 3.0 [SPARK-34392][SQL] Support ZoneOffset +h:mm in DateTimeUtils. getZoneId Feb 24, 2021
@SparkQA
Copy link

SparkQA commented Feb 24, 2021

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39975/

@SparkQA
Copy link

SparkQA commented Feb 24, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39979/

@SparkQA
Copy link

SparkQA commented Feb 24, 2021

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39979/

@SparkQA
Copy link

SparkQA commented Feb 24, 2021

Test build #135399 has finished for PR 31624 at commit 8b167b3.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Member

@MaxGekk MaxGekk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you just correct/replace by the pattern:

scala> "GMT+8:00".replaceFirst("(\\+|\\-)(\\d)(:|$)", "$10$2$3")
res9: String = GMT+08:00

@Karl-WangSK
Copy link
Contributor Author

Could you just correct/replace by the pattern:

scala> "GMT+8:00".replaceFirst("(\\+|\\-)(\\d)(:|$)", "$10$2$3")
res9: String = GMT+08:00

yes thx

@SparkQA
Copy link

SparkQA commented Feb 24, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/40000/

@SparkQA
Copy link

SparkQA commented Feb 24, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39999/

@SparkQA
Copy link

SparkQA commented Feb 24, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39999/

@SparkQA
Copy link

SparkQA commented Feb 24, 2021

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/40000/

@SparkQA
Copy link

SparkQA commented Feb 24, 2021

Test build #135410 has finished for PR 31624 at commit f3972c9.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Feb 24, 2021

Test build #135419 has finished for PR 31624 at commit eb09f48.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Feb 24, 2021

Test build #135420 has finished for PR 31624 at commit d5e2c1e.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Feb 24, 2021

Test build #135427 has finished for PR 31624 at commit 1e8244f.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Feb 25, 2021

Test build #135458 has finished for PR 31624 at commit 41e0cb0.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@srowen
Copy link
Member

srowen commented Feb 26, 2021

Merged to master. Do we want this in 3.1?

@maropu
Copy link
Member

maropu commented Feb 27, 2021

It seems spark v2.4 supports this syntax, so IMO it would be nice that branch-3.0/3.1 can have this fix, too, for making migrations costs from 2.4 to 3.x smaller. cc: @HyukjinKwon

@Karl-WangSK Karl-WangSK deleted the zone branch February 27, 2021 03:41
@yaooqinn
Copy link
Member

+1 for 3.1 and 3.0

srowen pushed a commit that referenced this pull request Feb 27, 2021
### What changes were proposed in this pull request?
To support +8:00 in Spark3 when execute sql
`select to_utc_timestamp("2020-02-07 16:00:00", "GMT+8:00")`

### Why are the changes needed?
+8:00 this format is supported in PostgreSQL,hive, presto, but not supported in Spark3
https://issues.apache.org/jira/browse/SPARK-34392

### Does this PR introduce _any_ user-facing change?
no

### How was this patch tested?
unit test

Closes #31624 from Karl-WangSK/zone.

Lead-authored-by: ShiKai Wang <wskqing@gmail.com>
Co-authored-by: Karl-WangSK <shikai.wang@linkflowtech.com>
Signed-off-by: Sean Owen <srowen@gmail.com>
@srowen
Copy link
Member

srowen commented Feb 27, 2021

Done for 3.1. We'll need a different backport for 3.0 as there are merge conflicts - if it is needed in 3.0

@maropu
Copy link
Member

maropu commented Feb 28, 2021

@Karl-WangSK Could you open a backport PR for branch-3.0?

maropu pushed a commit to maropu/spark that referenced this pull request Mar 5, 2021
To support +8:00 in Spark3 when execute sql
`select to_utc_timestamp("2020-02-07 16:00:00", "GMT+8:00")`

+8:00 this format is supported in PostgreSQL,hive, presto, but not supported in Spark3
https://issues.apache.org/jira/browse/SPARK-34392

no

unit test

Closes apache#31624 from Karl-WangSK/zone.

Lead-authored-by: ShiKai Wang <wskqing@gmail.com>
Co-authored-by: Karl-WangSK <shikai.wang@linkflowtech.com>
Signed-off-by: Sean Owen <srowen@gmail.com>
srowen pushed a commit that referenced this pull request Mar 5, 2021
…tZoneId

### What changes were proposed in this pull request?
To support +8:00 in Spark3 when execute sql
`select to_utc_timestamp("2020-02-07 16:00:00", "GMT+8:00")`

This is the backport of #31624 and the original author is Karl-WangSK .

### Why are the changes needed?
+8:00 this format is supported in PostgreSQL,hive, presto, but not supported in Spark3
https://issues.apache.org/jira/browse/SPARK-34392

### Does this PR introduce _any_ user-facing change?
no

### How was this patch tested?
unit test

Closes #31755 from maropu/SPARK-34392-BRANCH3.0.

Authored-by: ShiKai Wang <wskqing@gmail.com>
Signed-off-by: Sean Owen <srowen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
6 participants