GitHub user wgtmac opened a pull request:
https://github.com/apache/spark/pull/15035
[SPARK-17477]: SparkSQL cannot handle schema evolution from Int -> Loâ¦
## What changes were proposed in this pull request?
Using SparkSession in Spark 2.0 to read a Hive table which is stored as
parquet files and if there has been a schema evolution from int to long of a
column, we will get _java.lang.ClassCastException:
org.apache.spark.sql.catalyst.expressions.MutableLong cannot be cast to
org.apache.spark.sql.catalyst.expressions.MutableInt_. To be specific, if there
are some old parquet files using int for the column while some new parquet
files use long and the Hive metastore uses Long as its type, the aforementioned
exception will be thrown. Because Hive and Presto deem this kind of schema
evolution is valid, this PR allows writing a int value when its table schema is
long in hive metastore.
## How was this patch tested?
Manual testing and dev/run-tests
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/wgtmac/spark master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/15035.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 #15035
----
commit 9a6658cd8605dbd7bfcf0356a33d7d544e7e5471
Author: Gang Wu <[email protected]>
Date: 2016-09-09T20:29:50Z
[SPARK-17477]: SparkSQL cannot handle schema evolution from Int -> Long
when parquet files have Int as its type while hive metastore has Long as its
type
----
---
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]