Skip to content

[SPARK-11752][SQL] fix timezone problem for DateTimeUtils.getSeconds #9728

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
wants to merge 1 commit into from

Conversation

cloud-fan
Copy link
Contributor

code snippet to reproduce it:

TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"))
val t = Timestamp.valueOf("1900-06-11 12:14:50.789")
val us = fromJavaTimestamp(t)
assert(getSeconds(us) === t.getSeconds)

it will be good to add a regression test for it, but the reproducing code need to change the default timezone, and even we change it back, the lazy val defaultTimeZone in DataTimeUtils is fixed.

@cloud-fan
Copy link
Contributor Author

cc @davies

@davies
Copy link
Contributor

davies commented Nov 16, 2015

LGTM

@SparkQA
Copy link

SparkQA commented Nov 16, 2015

Test build #45986 has finished for PR 9728 at commit afc9664.

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

@davies
Copy link
Contributor

davies commented Nov 16, 2015

Merged into master, 1.6 and 1.5 branch

asfgit pushed a commit that referenced this pull request Nov 16, 2015
code snippet to reproduce it:
```
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"))
val t = Timestamp.valueOf("1900-06-11 12:14:50.789")
val us = fromJavaTimestamp(t)
assert(getSeconds(us) === t.getSeconds)
```

it will be good to add a regression test for it, but the reproducing code need to change the default timezone, and even we change it back, the `lazy val defaultTimeZone` in `DataTimeUtils` is fixed.

Author: Wenchen Fan <wenchen@databricks.com>

Closes #9728 from cloud-fan/seconds.

(cherry picked from commit 06f1fdb)
Signed-off-by: Davies Liu <davies.liu@gmail.com>
@asfgit asfgit closed this in 06f1fdb Nov 16, 2015
asfgit pushed a commit that referenced this pull request Nov 16, 2015
code snippet to reproduce it:
```
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"))
val t = Timestamp.valueOf("1900-06-11 12:14:50.789")
val us = fromJavaTimestamp(t)
assert(getSeconds(us) === t.getSeconds)
```

it will be good to add a regression test for it, but the reproducing code need to change the default timezone, and even we change it back, the `lazy val defaultTimeZone` in `DataTimeUtils` is fixed.

Author: Wenchen Fan <wenchen@databricks.com>

Closes #9728 from cloud-fan/seconds.

(cherry picked from commit 06f1fdb)
Signed-off-by: Davies Liu <davies.liu@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants