GitHub user HyukjinKwon opened a pull request:
https://github.com/apache/spark/pull/14919
[SPARK-17354][SQL] Partitioning by dates/timestamps should work with
Parquet vectorized reader
## What changes were proposed in this pull request?
This PR fixes `ColumnVectorUtils.populate` so that Parquet vectorized
reader can read partitioned table with dates/timestamps.
This is being only called within
[VectorizedParquetRecordReader.java#L185](https://github.com/apache/spark/blob/master/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedParquetRecordReader.java#L185).
When partition column types are explicitly given, this fails with the
exception below:
```
16/09/01 10:30:07 ERROR Executor: Exception in task 0.0 in stage 5.0 (TID 6)
java.lang.ClassCastException: java.lang.Integer cannot be cast to
java.sql.Date
at
org.apache.spark.sql.execution.vectorized.ColumnVectorUtils.populate(ColumnVectorUtils.java:89)
at
org.apache.spark.sql.execution.datasources.parquet.VectorizedParquetRecordReader.initBatch(VectorizedParquetRecordReader.java:185)
at
org.apache.spark.sql.execution.datasources.parquet.VectorizedParquetRecordReader.initBatch(VectorizedParquetRecordReader.java:204)
at
org.apache.spark.sql.execution.datasources.parquet.ParquetFileFormat$$anonfun$buildReader$1.apply(ParquetFileFormat.scala:362)
at
```
## How was this patch tested?
Unit tests in `SQLQuerySuite`.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/HyukjinKwon/spark SPARK-17354
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/14919.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 #14919
----
commit bef83fca16b7cda1021cbb2f992109a4c1624c0d
Author: hyukjinkwon <[email protected]>
Date: 2016-09-01T13:10:09Z
Partitioning by dates/timestamps works with Parquet vectorized reader
----
---
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]