GitHub user viirya opened a pull request:
https://github.com/apache/spark/pull/14365
[SPARK-16628][SQL] Translate file-based relation schema when file schema is
inconsistent with catalog schema
## What changes were proposed in this pull request?
We will convert Metastore Orc tables (represented by `MetastoreRelation`)
to datasource tables (represented by `HadoopFsRelation`) if
`spark.sql.hive.convertMetastoreOrc` is enabled for better performance.
However, due to a Hive issue, an Orc table created by Hive does not store
column name correctly in the Orc files. For these Orc tables, the converted
relation has wrong schema.
This PR adds a schema mapping to file-based datasource tables
(`HadoopFsRelation`).
This is another approach to deal with this issue. #14282 takes a simpler
approach to just disable the conversion.
## How was this patch tested?
Jenkins tests.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/viirya/spark-1 fix-file-ds-inconsistent-schema
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/14365.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 #14365
----
----
---
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]