GitHub user HyukjinKwon opened a pull request:
https://github.com/apache/spark/pull/14947
[SPARK-17388][SQL] Support for inferring type date/timestamp/decimal for
partition column
## What changes were proposed in this pull request?
Currently, Spark only supports to infer `IntegerType`, `LongType`,
`DoubleType` and `StringType`.
`DecimalType` is being tried but it seems it never infers type as
`DecimalType` as `DoubleType` is being tried first.
Also, `DateType` and `TimestampType` can be inferred. It seems it is a
pretty common to use both for a partition column.
It'd be great if they can be inferred as both rather than just `StringType`.
This PR fixes the incorrect `DecimalType` try and also adds the support for
both `DateType` and `TimestampType` for inferring partition column type.
## How was this patch tested?
Unit tests in `ParquetPartitionDiscoverySuite`.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/HyukjinKwon/spark SPARK-17388
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/14947.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 #14947
----
commit b7aa3a3ac045ead46d8ecfc1882d54a1f4dd1c37
Author: hyukjinkwon <[email protected]>
Date: 2016-09-03T06:47:57Z
Support for inferring type date/timestamp/decimal for partition column
----
---
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]