Skip to content

Commit

Permalink
update compressionCodecClassName to compressionCodecName
Browse files Browse the repository at this point in the history
update compressionCodecClassName to compressionCodecName
  • Loading branch information
fjh100456 authored Dec 25, 2017
1 parent 4ab7ecb commit 3cf0c04
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class CompressionCodecSuite extends TestHiveSingleton with SQLTestUtils {
withSQLConf(SQLConf.PARQUET_COMPRESSION.key -> c) {
val expected = if (c == "NONE") "UNCOMPRESSED" else c
val option = new ParquetOptions(Map.empty[String, String], spark.sessionState.conf)
assert(option.compressionCodecClassName == expected)
assert(option.compressionCodecName == expected)
}
}
}
Expand All @@ -40,22 +40,22 @@ class CompressionCodecSuite extends TestHiveSingleton with SQLTestUtils {
withSQLConf(SQLConf.PARQUET_COMPRESSION.key -> "snappy") {
val props = Map("compression" -> "uncompressed", ParquetOutputFormat.COMPRESSION -> "gzip")
val option = new ParquetOptions(props, spark.sessionState.conf)
assert(option.compressionCodecClassName == "UNCOMPRESSED")
assert(option.compressionCodecName == "UNCOMPRESSED")
}

// When "compression" is not configured, "parquet.compression" should be the preferred choice.
withSQLConf(SQLConf.PARQUET_COMPRESSION.key -> "snappy") {
val props = Map(ParquetOutputFormat.COMPRESSION -> "gzip")
val option = new ParquetOptions(props, spark.sessionState.conf)
assert(option.compressionCodecClassName == "GZIP")
assert(option.compressionCodecName == "GZIP")
}

// When both "compression" and "parquet.compression" are not configured,
// spark.sql.parquet.compression.codec should be the right choice.
withSQLConf(SQLConf.PARQUET_COMPRESSION.key -> "snappy") {
val props = Map.empty[String, String]
val option = new ParquetOptions(props, spark.sessionState.conf)
assert(option.compressionCodecClassName == "SNAPPY")
assert(option.compressionCodecName == "SNAPPY")
}
}
}

0 comments on commit 3cf0c04

Please sign in to comment.