Github user dongjoon-hyun commented on a diff in the pull request:
https://github.com/apache/spark/pull/19382#discussion_r142217964
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
---
@@ -2009,4 +2012,48 @@ class HiveDDLSuite
}
}
}
+
+ private def assertCompression(maybeFile: Option[File], format: String,
compression: String) = {
+ assert(maybeFile.isDefined)
+
+ val actualCompression = format match {
+ case "orc" =>
+
OrcFileOperator.getFileReader(maybeFile.get.toPath.toString).get.getCompression.name
+
+ case "parquet" =>
+ val footer = ParquetFileReader.readFooter(
+ sparkContext.hadoopConfiguration, new
Path(maybeFile.get.getPath), NO_FILTER)
+ footer.getBlocks.get(0).getColumns.get(0).getCodec.toString
+ }
+
+ assert(compression === actualCompression)
+ }
+
+ // Since ORC uses 'ZLIB' and Parquet uses 'SNAPPY' by default, we test
with different formats.
+ Seq(("orc", "SNAPPY"), ("parquet", "GZIP")).foreach { case (fileFormat,
compression) =>
+ test(s"SPARK-22158 convertMetastore should not ignore table property -
$fileFormat") {
--- End diff --
Hi, @gatorsmile .
Now, this test is focusing solely on `convertMetastore should not ignore
table property` case.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]