GitHub user HyukjinKwon opened a pull request:
https://github.com/apache/spark/pull/17348
[SPARK-20018][SQL] Pivot with timestamp and count should not print internal
representation
## What changes were proposed in this pull request?
Currently, when we perform count with timestamp types, it prints the
internal representation as the column name as below:
```scala
Seq(new
java.sql.Timestamp(1)).toDF("a").groupBy("a").pivot("a").count().show()
```
```
+--------------------+----+
| a|1000|
+--------------------+----+
|1969-12-31 16:00:...| 1|
+--------------------+----+
```
This PR proposes to use external Scala value instead of the internal
representation in the column names as below:
```
+--------------------+-----------------------+
| a|1969-12-31 16:00:00.001|
+--------------------+-----------------------+
|1969-12-31 16:00:...| 1|
+--------------------+-----------------------+
```
## How was this patch tested?
Unit test in `DataFramePivotSuite` and manual tests.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/HyukjinKwon/spark SPARK-20018
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/17348.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 #17348
----
commit d64a2b13e56330c55dac29abc3a9ccb6085ce73f
Author: hyukjinkwon <[email protected]>
Date: 2017-03-19T13:42:25Z
Pivot with timestamp and count should not print internal representation
----
---
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]