Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/19055#discussion_r135956579
--- Diff:
sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcOptions.scala ---
@@ -20,30 +20,33 @@ package org.apache.spark.sql.hive.orc
import java.util.Locale
import org.apache.spark.sql.catalyst.util.CaseInsensitiveMap
+import org.apache.spark.sql.internal.SQLConf
/**
* Options for the ORC data source.
*/
-private[orc] class OrcOptions(@transient private val parameters:
CaseInsensitiveMap[String])
+private[orc] class OrcOptions(
+ @transient private val parameters: CaseInsensitiveMap[String],
+ @transient private val sqlConf: SQLConf)
extends Serializable {
import OrcOptions._
- def this(parameters: Map[String, String]) =
this(CaseInsensitiveMap(parameters))
+ def this(parameters: Map[String, String], sqlConf: SQLConf) =
+ this(CaseInsensitiveMap(parameters), sqlConf)
/**
- * Compression codec to use. By default snappy compression.
+ * Compression codec to use.
* Acceptable values are defined in [[shortOrcCompressionCodecNames]].
*/
val compressionCodec: String = {
- // `orc.compress` is a ORC configuration. So, here we respect this as
an option but
- // `compression` has higher precedence than `orc.compress`. It means
if both are set,
- // we will use `compression`.
+ // `compression`, `orc.compress`, and
`spark.sql.orc.compression.codec` is used in order.
val orcCompressionConf = parameters.get(OrcRelation.ORC_COMPRESSION)
val codecName = parameters
.get("compression")
.orElse(orcCompressionConf)
- .getOrElse("snappy").toLowerCase(Locale.ROOT)
+ .getOrElse(sqlConf.orcCompressionCodec)
--- End diff --
Could we update the default values for consistency with Parquet one? :
https://github.com/apache/spark/blob/3c0c2d09ca89c6b6247137823169db17847dfae3/sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriter.scala#L520
https://github.com/apache/spark/blob/51620e288b5e0a7fffc3899c9deadabace28e6d7/python/pyspark/sql/readwriter.py#L855
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]