byronwang123 commented on code in PR #7636:
URL: https://github.com/apache/kyuubi/pull/7636#discussion_r3804353760


##########
externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/spark/sql/kyuubi/SparkDatasetHelper.scala:
##########
@@ -77,6 +79,28 @@ object SparkDatasetHelper extends Logging {
     toArrowBatchRddMethod.bind(ds).invoke()
   }
 
+  /**
+   * Read the arrow compression codec config from the session conf, reusing 
the Spark upstream
+   * configuration keys (`spark.sql.execution.arrow.compression.codec` and
+   * `spark.sql.execution.arrow.compression.zstd.level`, introduced in Spark 
4.1). On Spark < 4.1
+   * these keys are not registered as typed SQLConf entries, so they are read 
as raw strings: a
+   * session-level SET lands in the SQLConf settings map and takes precedence, 
otherwise the
+   * engine-level kyuubi-defaults.conf value applies, otherwise the default.
+   * Returns (codecName, zstdLevel).
+   */
+  private def arrowCompressionConf(spark: SparkSession): (String, Int) = {
+    // Lower-case the codec name to match Spark upstream, whose typed entry 
applies
+    // `.transform(_.toLowerCase(Locale.ROOT))`; reading the key as a raw 
string here would
+    // otherwise make `ZSTD`/`Zstd` reject on Spark < 4.1 while accepted 
natively on 4.1+.

Review Comment:
   Addressed.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to