Github user lw-lin commented on a diff in the pull request:
https://github.com/apache/spark/pull/13575#discussion_r66466310
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVRelation.scala
---
@@ -143,39 +146,99 @@ object CSVRelation extends Logging {
if (nonEmptyLines.hasNext) nonEmptyLines.drop(1)
}
}
+
+ /**
+ * Setup writing configurations into the given [[Configuration]], and
then return the
+ * wrapped [[CSVOptions]].
+ * Both continuous-queries writing process and non-continuous-queries
writing process will
+ * call this function.
+ */
+ private[csv] def prepareConfForWriting(
+ conf: Configuration,
+ options: Map[String, String]): CSVOptions = {
+ val csvOptions = new CSVOptions(options)
+ csvOptions.compressionCodec.foreach { codec =>
+ CompressionCodecs.setCodecConfiguration(conf, codec)
+ }
+ csvOptions
+ }
--- End diff --
These mostly are moved from `CSVFileFormat.prepareWrite()` to here
---
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]