Skip to content

Commit 732266c

Browse files
committed
[SPARK-21786][SQL] The 'spark.sql.parquet.compression.codec' configuration doesn't take effect on tables with partition field(s)
Fix test problem
1 parent 5cbe999 commit 732266c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

sql/hive/src/test/scala/org/apache/spark/sql/hive/InsertSuite.scala

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ class InsertSuite extends QueryTest with TestHiveSingleton with BeforeAndAfter
770770
def checkCompressionCodec(format: String)(f: File => Unit): Unit = {
771771
withTempDir { tmpDir =>
772772
withTempView("table_source") {
773-
(0 until 10000).toDF("a").createOrReplaceTempView("table_source")
773+
(0 until 100000).toDF("a").createOrReplaceTempView("table_source")
774774

775775
withTable(tableWithPartition, tableNoPartition) {
776776
sql(
@@ -809,15 +809,14 @@ class InsertSuite extends QueryTest with TestHiveSingleton with BeforeAndAfter
809809

810810
val orcCompression = "spark.sql.orc.compression.codec"
811811
checkCompressionCodec("ORC") { tmpDir =>
812-
val maxDiff = 1024
813812
assert(getTableSize(tmpDir, tableWithPartition, orcCompression, "none", true)
814-
- getTableSize(tmpDir, tableNoPartition, orcCompression, "none") < maxDiff)
813+
== getTableSize(tmpDir, tableNoPartition, orcCompression, "none"))
815814
assert(getTableSize(tmpDir, tableWithPartition, orcCompression, "uncompressed", true)
816815
== getTableSize(tmpDir, tableNoPartition, orcCompression, "none"))
817816
assert(getTableSize(tmpDir, tableWithPartition, orcCompression, "zlib", true)
818-
- getTableSize(tmpDir, tableNoPartition, orcCompression, "zlib") < maxDiff)
817+
== getTableSize(tmpDir, tableNoPartition, orcCompression, "zlib"))
819818
assert(getTableSize(tmpDir, tableWithPartition, orcCompression, "none", true)
820-
- getTableSize(tmpDir, tableWithPartition, orcCompression, "zlib", true) > maxDiff)
819+
> getTableSize(tmpDir, tableWithPartition, orcCompression, "zlib", true))
821820
}
822821
}
823822
}

0 commit comments

Comments
 (0)