Skip to content

Conversation

@viirya
Copy link
Member

@viirya viirya commented Jul 20, 2016

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, we can't do the conversion.

This PR tries to compare the inferred schema of Orc files with Metastore schema. If they don't match, we skip the conversion and continue to use MetastoreRelation.

As Parquet will have similar conversion, this PR does the same checking for it too.

How was this patch tested?

Jenkins tests.

…tastore schema does not match schema stored in the Orc/Parquet files.
@SparkQA
Copy link

SparkQA commented Jul 20, 2016

Test build #62590 has finished for PR 14282 at commit 90444a2.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@rxin
Copy link
Contributor

rxin commented Jul 20, 2016

Shouldn't the proper fix be addressing the issue for conversion, rather than disabling conversion?

@viirya
Copy link
Member Author

viirya commented Jul 22, 2016

Agreed. This is just the option 1 in the JIRA. The option 2 needs to change more codes. I will look into it.

@viirya
Copy link
Member Author

viirya commented Dec 8, 2016

This can be closed now because we don't infer schema from Orc files when converting Hive Orc tables to data source tables anymore.

@viirya viirya closed this Dec 8, 2016
@viirya viirya deleted the detect-schema-when-convert-relation branch December 27, 2023 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants