Skip to content

Commit 0cb7b7a

Browse files
committed
[SPARK-21786][SQL] The 'spark.sql.parquet.compression.codec' and 'spark.sql.orc.compression.codec' configuration doesn't take effect on hive table writing
Fix scala style
1 parent d779ee6 commit 0cb7b7a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetOptions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ package org.apache.spark.sql.execution.datasources.parquet
1919

2020
import java.util.Locale
2121

22-
import org.apache.parquet.hadoop.metadata.CompressionCodecName
2322
import org.apache.parquet.hadoop.ParquetOutputFormat
23+
import org.apache.parquet.hadoop.metadata.CompressionCodecName
2424

2525
import org.apache.spark.sql.catalyst.util.CaseInsensitiveMap
2626
import org.apache.spark.sql.internal.SQLConf

sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveOptions.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ package org.apache.spark.sql.hive.execution
2020
import java.util.Locale
2121

2222
import scala.collection.JavaConverters._
23+
2324
import org.apache.hadoop.hive.ql.plan.{FileSinkDesc, TableDesc}
2425
import org.apache.orc.OrcConf.COMPRESS
2526
import org.apache.parquet.hadoop.ParquetOutputFormat
27+
2628
import org.apache.spark.sql.catalyst.util.CaseInsensitiveMap
2729
import org.apache.spark.sql.execution.datasources.orc.OrcOptions
2830
import org.apache.spark.sql.execution.datasources.parquet.ParquetOptions
@@ -110,7 +112,7 @@ object HiveOptions {
110112
"mapkeyDelim" -> "mapkey.delim",
111113
"lineDelim" -> "line.delim").map { case (k, v) => k.toLowerCase(Locale.ROOT) -> v }
112114

113-
def getHiveWriteCompression(tableInfo: TableDesc, sqlConf: SQLConf): Option[(String, String)]= {
115+
def getHiveWriteCompression(tableInfo: TableDesc, sqlConf: SQLConf): Option[(String, String)] = {
114116
tableInfo.getOutputFileFormatClassName.toLowerCase match {
115117
case formatName if formatName.endsWith("parquetoutputformat") =>
116118
val compressionCodec = new ParquetOptions(tableInfo.getProperties.asScala.toMap,

0 commit comments

Comments
 (0)