-
Notifications
You must be signed in to change notification settings - Fork 28.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-22158][SQL] convertMetastore should not ignore table property #19382
Conversation
Test build #82283 has finished for PR 19382 at commit
|
sql( | ||
s""" | ||
|CREATE TABLE t(id int) USING hive | ||
|OPTIONS(fileFormat 'orc', compression 'Zlib') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It sounds like we have the same issue for parquet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for review, @gatorsmile . I'll check that, too.
@@ -189,12 +189,12 @@ case class RelationConversions( | |||
private def convert(relation: HiveTableRelation): LogicalRelation = { | |||
val serde = relation.tableMeta.storage.serde.getOrElse("").toLowerCase(Locale.ROOT) | |||
if (serde.contains("parquet")) { | |||
val options = Map(ParquetOptions.MERGE_SCHEMA -> | |||
val options = relation.tableMeta.storage.properties + (ParquetOptions.MERGE_SCHEMA -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @gatorsmile . It's the same in the Paquet. Without this, the test case for parquet fails.
|LOCATION '${path.toURI}' | ||
""".stripMargin) | ||
|CREATE TABLE t(id int) USING hive | ||
|OPTIONS(fileFormat 'parquet', compression 'gzip') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parquet use gzip
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you combine these two test cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, it's not feasible. First of all,
- Old ORC test case covers
convertMetastoreOrc=false
only. So, I extended it to cover both. - New Parquet test case covers `convertMetastoreParquet=true (default) only because Parquet has another bug when convertMetastoreParquet=false.
Also, the compression codec check is quite different between ORC and Parquet. Please see line 1510.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still can create a common helper function, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try your best to reduce duplicate codes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
sparkContext.hadoopConfiguration, | ||
new Path(maybeParquetFile.get.getPath), | ||
NO_FILTER) | ||
assert("GZIP" === footer.getBlocks.get(0).getColumns().get(0).getCodec.toString) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's for getting compression codec.
@gatorsmile . |
Test build #82324 has finished for PR 19382 at commit
|
It fails due to
|
Retest this please |
Retest this please. |
I retriggered because I noticed that master branch is fixed after the previous triggering. |
Test build #82327 has finished for PR 19382 at commit
|
Test build #82332 has finished for PR 19382 at commit
|
Retest this please |
Test build #82391 has finished for PR 19382 at commit
|
Test build #82395 has finished for PR 19382 at commit
|
LGTM Thanks! Merged to master. |
Please submit a separate PR to 2.2. Thanks! |
Thank you, @gatorsmile . I'll. |
What changes were proposed in this pull request?
From the beginning, convertMetastoreOrc ignores table properties and use an empty map instead. This PR fixes that. For the diff, please see this. convertMetastoreParquet also ignore.
How was this patch tested?
Pass the Jenkins with an updated test suite.