https://github.com/apache/spark
Revision 41efd2091781b31118c6d37be59e4f0f4ae2bf66 authored by Davies Liu on 19 June 2016, 07:34:52 UTC, committed by Davies Liu on 19 June 2016, 07:35:17 UTC
## What changes were proposed in this pull request? Internally, we use Int to represent a date (the days since 1970-01-01), when we convert that into unix timestamp (milli-seconds since epoch in UTC), we get the offset of a timezone using local millis (the milli-seconds since 1970-01-01 in a timezone), but TimeZone.getOffset() expect unix timestamp, the result could be off by one hour (in Daylight Saving Time (DST) or not). This PR change to use best effort approximate of posix timestamp to lookup the offset. In the event of changing of DST, Some time is not defined (for example, 2016-03-13 02:00:00 PST), or could lead to multiple valid result in UTC (for example, 2016-11-06 01:00:00), this best effort approximate should be enough in practice. ## How was this patch tested? Added regression tests. Author: Davies Liu <davies@databricks.com> Closes #13652 from davies/fix_timezone. (cherry picked from commit 001a58960311b07fe80e2f01e473f4987948d06e) Signed-off-by: Davies Liu <davies.liu@gmail.com>
1 parent 3f1d730
Tip revision: 41efd2091781b31118c6d37be59e4f0f4ae2bf66 authored by Davies Liu on 19 June 2016, 07:34:52 UTC
[SPARK-15613] [SQL] Fix incorrect days to millis conversion due to Daylight Saving Time
[SPARK-15613] [SQL] Fix incorrect days to millis conversion due to Daylight Saving Time
Tip revision: 41efd20
File | Mode | Size |
---|---|---|
R | ||
assembly | ||
bagel | ||
bin | ||
build | ||
conf | ||
core | ||
data | ||
dev | ||
docker | ||
docker-integration-tests | ||
docs | ||
ec2 | ||
examples | ||
external | ||
extras | ||
graphx | ||
launcher | ||
licenses | ||
mllib | ||
network | ||
project | ||
python | ||
repl | ||
sbin | ||
sbt | ||
sql | ||
streaming | ||
tags | ||
tools | ||
unsafe | ||
yarn | ||
.gitattributes | -rw-r--r-- | 40 bytes |
.gitignore | -rw-r--r-- | 1.1 KB |
.rat-excludes | -rw-r--r-- | 1.2 KB |
CHANGES.txt | -rw-r--r-- | 1.3 MB |
CONTRIBUTING.md | -rw-r--r-- | 988 bytes |
LICENSE | -rw-r--r-- | 16.9 KB |
NOTICE | -rw-r--r-- | 23.0 KB |
README.md | -rw-r--r-- | 3.3 KB |
make-distribution.sh | -rwxr-xr-x | 8.4 KB |
pom.xml | -rw-r--r-- | 89.7 KB |
pylintrc | -rw-r--r-- | 13.7 KB |
scalastyle-config.xml | -rw-r--r-- | 12.9 KB |
tox.ini | -rw-r--r-- | 848 bytes |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...