LuciferYang commented on code in PR #43308:
URL: https://github.com/apache/spark/pull/43308#discussion_r1372808047
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetIOSuite.scala:
##########
@@ -857,12 +855,12 @@ class ParquetIOSuite extends QueryTest with ParquetTest
with SharedSparkSession
// Checks default compression codec
checkCompressionCodec(
-
CompressionCodecName.fromConf(spark.conf.get(SQLConf.PARQUET_COMPRESSION)))
+
ParquetCompressionCodec.fromString(spark.conf.get(SQLConf.PARQUET_COMPRESSION)))
- checkCompressionCodec(CompressionCodecName.UNCOMPRESSED)
- checkCompressionCodec(CompressionCodecName.GZIP)
- checkCompressionCodec(CompressionCodecName.SNAPPY)
- checkCompressionCodec(CompressionCodecName.ZSTD)
+ checkCompressionCodec(ParquetCompressionCodec.UNCOMPRESSED)
Review Comment:
Unrelated to this pr, but why were only four types of Compression Codec
tested here? Was the test case not modified when a new type was added?
##########
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala:
##########
@@ -2709,31 +2709,32 @@ class HiveDDLSuite
assert(compression === actualCompression)
}
- Seq(("orc", "ZLIB"), ("parquet", "GZIP")).foreach { case (fileFormat,
compression) =>
- test(s"SPARK-22158 convertMetastore should not ignore table property -
$fileFormat") {
- withSQLConf(CONVERT_METASTORE_ORC.key -> "true",
CONVERT_METASTORE_PARQUET.key -> "true") {
- withTable("t") {
- withTempPath { path =>
- sql(
- s"""
- |CREATE TABLE t(id int) USING hive
- |OPTIONS(fileFormat '$fileFormat', compression '$compression')
- |LOCATION '${path.toURI}'
+ Seq(("orc", "ZLIB"), ("parquet", ParquetCompressionCodec.GZIP.name)).foreach
{
Review Comment:
nit: Make `Seq(("orc", "ZLIB"), ("parquet",
ParquetCompressionCodec.GZIP.name))` a variable, and then use `seq..foreach {
case (fileFormat, compression) =>`. Would the code below need to be reformatted?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]