GitHub user aokolnychyi opened a pull request:
https://github.com/apache/spark/pull/18252
[SPARK-17914][SQL] Fix parsing of timestamp strings with nanoseconds
The PR contains a tiny change to fix the way Spark parses string literals
into timestamps. Currently, some timestamps that contain nanoseconds are
corrupted during the conversion from internal UTF8Strings into the internal
representation of timestamps.
Consider the following example:
```
spark.sql("SELECT cast('2015-01-02 00:00:00.000000001' as
TIMESTAMP)").show(false)
+------------------------------------------------+
|CAST(2015-01-02 00:00:00.000000001 AS TIMESTAMP)|
+------------------------------------------------+
|2015-01-02 00:00:00.000001 |
+------------------------------------------------+
```
The fix was tested with existing tests. Also, there is a new test to cover
cases that did not work previously.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/aokolnychyi/spark spark-17914
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/18252.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #18252
----
commit 2f232a7bda28fb42759ee35923044f886a1ff19e
Author: aokolnychyi <[email protected]>
Date: 2017-06-08T18:52:14Z
[SPARK-17914][SQL] Fix parsing of timestamp strings with nanoseconds
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]