-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-21786][SQL] The 'spark.sql.parquet.compression.codec' and 'spark.sql.orc.compression.codec' configuration doesn't take effect on hive table writing #20087
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
9bbfe6e
48cf108
5dbd3ed
5124f1b
6907a3e
67e40d4
e2526ca
8ae86ee
94ac716
43e041f
ee0c558
e9f705d
d3aa7a0
5244aaf
b96a213
a05e85e
b962488
27c949d
79f7263
a51212b
f51c8fd
1860a43
a7cfd6b
eb99b8a
1f5e354
bcfeef5
cd92913
bc4bef4
2ab4012
84707f0
ea9da61
158f7e6
145820b
5b524cc
f9dcdbc
fd4e304
0a30e93
d1f422c
55afac4
bf85301
3e3e938
7236914
e6449e8
0377755
b66700a
f9e7b0c
285d342
bd1a80a
584cdc2
5b150bc
2337edd
43e7eb5
4b89b44
6cf32e0
365c5bf
99271d6
2b9dfbe
5b5e1df
118f788
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,16 +19,16 @@ package org.apache.spark.sql.execution.datasources.parquet | |
|
|
||
| import java.util.Locale | ||
|
|
||
| import org.apache.parquet.hadoop.metadata.CompressionCodecName | ||
| import org.apache.parquet.hadoop.ParquetOutputFormat | ||
| import org.apache.parquet.hadoop.metadata.CompressionCodecName | ||
|
|
||
| import org.apache.spark.sql.catalyst.util.CaseInsensitiveMap | ||
| import org.apache.spark.sql.internal.SQLConf | ||
|
|
||
| /** | ||
| * Options for the Parquet data source. | ||
| */ | ||
| private[parquet] class ParquetOptions( | ||
| class ParquetOptions( | ||
| @transient private val parameters: CaseInsensitiveMap[String], | ||
| @transient private val sqlConf: SQLConf) | ||
| extends Serializable { | ||
|
|
@@ -76,7 +76,7 @@ object ParquetOptions { | |
| val MERGE_SCHEMA = "mergeSchema" | ||
|
|
||
| // The parquet compression short names | ||
| private val shortParquetCompressionCodecNames = Map( | ||
| val shortParquetCompressionCodecNames = Map( | ||
|
||
| "none" -> CompressionCodecName.UNCOMPRESSED, | ||
| "uncompressed" -> CompressionCodecName.UNCOMPRESSED, | ||
| "snappy" -> CompressionCodecName.SNAPPY, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -68,6 +68,10 @@ private[hive] trait SaveAsHiveFile extends DataWritingCommand { | |
| .get("mapreduce.output.fileoutputformat.compress.type")) | ||
| } | ||
|
|
||
| // Set compression by priority | ||
| HiveOptions.getHiveWriteCompression(fileSinkConf.getTableInfo, sparkSession.sessionState.conf) | ||
| .foreach { case (compression, codec) => hadoopConf.set(compression, codec) } | ||
|
||
|
|
||
| val committer = FileCommitProtocol.instantiate( | ||
| sparkSession.sessionState.conf.fileCommitProtocolClass, | ||
| jobId = java.util.UUID.randomUUID().toString, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of changing the access modifiers, add a public function