diff options
author | Wenchen Fan <cloud0fan@outlook.com> | 2015-07-18 11:25:16 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2015-07-18 11:25:16 -0700 |
commit | 692378c01d949dfe2b2a884add153cd5f8054b5a (patch) | |
tree | aee5883e699fbaa79354823b1560143098745115 /ec2 | |
parent | 1b4ff05538fbcfe10ca4fa97606bd6e39a8450cb (diff) | |
download | spark-692378c01d949dfe2b2a884add153cd5f8054b5a.tar.gz spark-692378c01d949dfe2b2a884add153cd5f8054b5a.tar.bz2 spark-692378c01d949dfe2b2a884add153cd5f8054b5a.zip |
[SPARK-9167][SQL] use UTC Calendar in `stringToDate`
fix 2 bugs introduced in https://github.com/apache/spark/pull/7353
1. we should use UTC Calendar when cast string to date . Before #7353 , we use `DateTimeUtils.fromJavaDate(Date.valueOf(s.toString))` to cast string to date, and `fromJavaDate` will call `millisToDays` to avoid the time zone issue. Now we use `DateTimeUtils.stringToDate(s)`, we should create a Calendar with UTC in the begging.
2. we should not change the default time zone in test cases. The `threadLocalLocalTimeZone` and `threadLocalTimestampFormat` in `DateTimeUtils` will only be evaluated once for each thread, so we can't set the default time zone back anymore.
Author: Wenchen Fan <cloud0fan@outlook.com>
Closes #7488 from cloud-fan/datetime and squashes the following commits:
9cd6005 [Wenchen Fan] address comments
21ef293 [Wenchen Fan] fix 2 bugs in datetime
Diffstat (limited to 'ec2')
0 files changed, 0 insertions, 0 deletions