GitHub user budde opened a pull request:
https://github.com/apache/spark/pull/17249
[SPARK-19611][SQL] Preserve metastore field order when merging inferred
schema
## What changes were proposed in this pull request?
The ```HiveMetastoreCatalog.mergeWithMetastoreSchema()``` method added in
#16944 may
not preserve the same field order as the metastore schema in some cases,
which can cause
queries to fail. This change ensures that the metastore field order is
preserved.
## How was this patch tested?
A test for ensuring that metastore order is preserved was added to
```HiveSchemaInferenceSuite.```
The particular failure usecase from #16944 was tested manually as well.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/budde/spark PreserveMetastoreFieldOrder
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/17249.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 #17249
----
commit 99eb2dc9b07e953249b4ece6ea3a44ecebc9287b
Author: Budde <[email protected]>
Date: 2017-03-10T21:04:22Z
[SPARK-19611][SQL] Preserve metastore field order when merging inferred
schema
The ```HiveMetastoreCatalog.mergeWithMetastoreSchema()``` method added in
#16944 may
not preserve the same field order as the metastore schema in some cases,
which can cause
queries to fail. This change ensures that the metastore field order is
preserved.
A test for ensuring that metastore order is preserved was added to
```HiveSchemaInferenceSuite.```
The particular failure usecase from #16944 was tested manually as well.
----
---
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]