You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "cxzl25 (via GitHub)" <gi...@apache.org> on 2024/03/19 04:26:57 UTC

[PR] [SPARK-47456][SQL] Support ORC Brotli codec [spark]

cxzl25 opened a new pull request, #45584:
URL: https://github.com/apache/spark/pull/45584

   ### What changes were proposed in this pull request?
   This PR aims to support ORC Brotli codec.
   
   ### Why are the changes needed?
   Currently, the master branch of Spark has used ORC 2.0.0 version and supports brotli compression encoding. ([SPARK-44115](https://issues.apache.org/jira/browse/SPARK-44115))
   However, due to some hardcode checks in Spark, brotli cannot be used normally.
   
   ```sql
   set spark.sql.orc.compression.codec=BROTLI;
   ```
   
   ```
   java.lang.IllegalArgumentException: The value of spark.sql.orc.compression.codec should be one of uncompressed, lz4, lzo, snappy, zlib, none, zstd, but was brotli
   ```
   
   See https://github.com/apache/orc/pull/1714
   
   ### Does this PR introduce _any_ user-facing change?
   Yes
   
   In this PR, add the corresponding brotli jar package, we can use orc brotli encoding.
   
   ### How was this patch tested?
   local test
   
   ### Was this patch authored or co-authored using generative AI tooling?
   No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-47456][SQL] Support ORC Brotli codec [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #45584:
URL: https://github.com/apache/spark/pull/45584#discussion_r1529743993


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileSourceCodecSuite.scala:
##########
@@ -71,6 +71,9 @@ class OrcCodecSuite extends FileSourceCodecSuite {
 
   override def format: String = "orc"
   override val codecConfigName: String = SQLConf.ORC_COMPRESSION.key
+  // Exclude "BROTLI" because its dependencies
+  // require adding different jars according to different OSs

Review Comment:
   As he mentioned, native brotli should be available in the system, too.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-47456][SQL] Support ORC Brotli codec [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun closed pull request #45584: [SPARK-47456][SQL] Support ORC Brotli codec
URL: https://github.com/apache/spark/pull/45584


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-47456][SQL] Support ORC Brotli codec [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #45584:
URL: https://github.com/apache/spark/pull/45584#discussion_r1529740045


##########
docs/sql-data-sources-orc.md:
##########
@@ -241,7 +241,7 @@ Data source options of ORC can be set via:
   <tr>
     <td><code>compression</code></td>
     <td><code>zstd</code></td>
-    <td>compression codec to use when saving to file. This can be one of the known case-insensitive shorten names (none, snappy, zlib, lzo, zstd and lz4). This will override <code>orc.compress</code> and <code>spark.sql.orc.compression.codec</code>.</td>
+    <td>compression codec to use when saving to file. This can be one of the known case-insensitive shorten names (none, snappy, zlib, lzo, zstd, lz4 and brotli). This will override <code>orc.compress</code> and <code>spark.sql.orc.compression.codec</code>.</td>

Review Comment:
   Like Parquet, we need a `Note` here. 
   
   https://github.com/apache/spark/blob/5f48931fcdf712c3646a368ae9643b5ccba00db2/docs/sql-data-sources-parquet.md?plain=1#L488



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-47456][SQL] Support ORC Brotli codec [spark]

Posted by "cxzl25 (via GitHub)" <gi...@apache.org>.
cxzl25 commented on code in PR #45584:
URL: https://github.com/apache/spark/pull/45584#discussion_r1529764686


##########
docs/sql-data-sources-orc.md:
##########
@@ -241,7 +241,7 @@ Data source options of ORC can be set via:
   <tr>
     <td><code>compression</code></td>
     <td><code>zstd</code></td>
-    <td>compression codec to use when saving to file. This can be one of the known case-insensitive shorten names (none, snappy, zlib, lzo, zstd and lz4). This will override <code>orc.compress</code> and <code>spark.sql.orc.compression.codec</code>.</td>
+    <td>compression codec to use when saving to file. This can be one of the known case-insensitive shorten names (none, snappy, zlib, lzo, zstd, lz4 and brotli). This will override <code>orc.compress</code> and <code>spark.sql.orc.compression.codec</code>.</td>

Review Comment:
   Thanks. Updated.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-47456][SQL] Support ORC Brotli codec [spark]

Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on code in PR #45584:
URL: https://github.com/apache/spark/pull/45584#discussion_r1529724232


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileSourceCodecSuite.scala:
##########
@@ -71,6 +71,9 @@ class OrcCodecSuite extends FileSourceCodecSuite {
 
   override def format: String = "orc"
   override val codecConfigName: String = SQLConf.ORC_COMPRESSION.key
+  // Exclude "BROTLI" because its dependencies
+  // require adding different jars according to different OSs

Review Comment:
   Which jar should be used when the user wants to enable this feature?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-47456][SQL] Support ORC Brotli codec [spark]

Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on code in PR #45584:
URL: https://github.com/apache/spark/pull/45584#discussion_r1529746044


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileSourceCodecSuite.scala:
##########
@@ -71,6 +71,9 @@ class OrcCodecSuite extends FileSourceCodecSuite {
 
   override def format: String = "orc"
   override val codecConfigName: String = SQLConf.ORC_COMPRESSION.key
+  // Exclude "BROTLI" because its dependencies
+  // require adding different jars according to different OSs

Review Comment:
   OK~



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-47456][SQL] Support ORC Brotli codec [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #45584:
URL: https://github.com/apache/spark/pull/45584#issuecomment-2005843890

   Merged to master for Apache Spark 4.0.0.
   
   Thank you, @cxzl25 , @yaooqinn , @LuciferYang !


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-47456][SQL] Support ORC Brotli codec [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #45584:
URL: https://github.com/apache/spark/pull/45584#discussion_r1529740045


##########
docs/sql-data-sources-orc.md:
##########
@@ -241,7 +241,7 @@ Data source options of ORC can be set via:
   <tr>
     <td><code>compression</code></td>
     <td><code>zstd</code></td>
-    <td>compression codec to use when saving to file. This can be one of the known case-insensitive shorten names (none, snappy, zlib, lzo, zstd and lz4). This will override <code>orc.compress</code> and <code>spark.sql.orc.compression.codec</code>.</td>
+    <td>compression codec to use when saving to file. This can be one of the known case-insensitive shorten names (none, snappy, zlib, lzo, zstd, lz4 and brotli). This will override <code>orc.compress</code> and <code>spark.sql.orc.compression.codec</code>.</td>

Review Comment:
   Like Parquet, we need a `Note` here, @cxzl25 .
   
   https://github.com/apache/spark/blob/5f48931fcdf712c3646a368ae9643b5ccba00db2/docs/sql-data-sources-parquet.md?plain=1#L488



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-47456][SQL] Support ORC Brotli codec [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #45584:
URL: https://github.com/apache/spark/pull/45584#discussion_r1529732727


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileSourceCodecSuite.scala:
##########
@@ -71,6 +71,9 @@ class OrcCodecSuite extends FileSourceCodecSuite {
 
   override def format: String = "orc"
   override val codecConfigName: String = SQLConf.ORC_COMPRESSION.key
+  // Exclude "BROTLI" because its dependencies
+  // require adding different jars according to different OSs

Review Comment:
   This one. I excluded intentionally during upgrading to Apache ORC 2.0.0.
   
   https://github.com/apache/spark/blob/681b41f0808e35313f4b63ca735f604d9ffc687f/pom.xml#L2615-L2618



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-47456][SQL] Support ORC Brotli codec [spark]

Posted by "cxzl25 (via GitHub)" <gi...@apache.org>.
cxzl25 commented on code in PR #45584:
URL: https://github.com/apache/spark/pull/45584#discussion_r1529764515


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileSourceCodecSuite.scala:
##########
@@ -71,6 +71,9 @@ class OrcCodecSuite extends FileSourceCodecSuite {
 
   override def format: String = "orc"
   override val codecConfigName: String = SQLConf.ORC_COMPRESSION.key
+  // Exclude "BROTLI" because its dependencies
+  // require adding different jars according to different OSs

Review Comment:
   Thanks for the comment, I've added the dependencies that need to be added to the PR description.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org