-
Notifications
You must be signed in to change notification settings - Fork 28.1k
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
Conversation
ok to test |
cc: @MaxGekk |
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala
Show resolved
Hide resolved
Could you make the PR title clearer? Probably, it should be like |
Test build #135395 has started for PR 31624 at commit |
Kubernetes integration test starting |
Kubernetes integration test status success |
Kubernetes integration test starting |
Kubernetes integration test status success |
Test build #135399 has finished for PR 31624 at commit
|
There was a problem hiding this 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
yes thx |
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala
Outdated
Show resolved
Hide resolved
Kubernetes integration test starting |
Kubernetes integration test starting |
Kubernetes integration test status failure |
Kubernetes integration test status success |
Test build #135410 has finished for PR 31624 at commit
|
Test build #135419 has finished for PR 31624 at commit
|
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala
Outdated
Show resolved
Hide resolved
Test build #135420 has finished for PR 31624 at commit
|
Test build #135427 has finished for PR 31624 at commit
|
Test build #135458 has finished for PR 31624 at commit
|
Merged to master. Do we want this in 3.1? |
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 |
+1 for 3.1 and 3.0 |
### 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>
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 |
@Karl-WangSK Could you open a backport PR for branch-3.0? |
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>
…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>
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