pan3793 commented on code in PR #4797:
URL: https://github.com/apache/kyuubi/pull/4797#discussion_r1186630301
##########
externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/spark/sql/execution/arrow/KyuubiArrowConverters.scala:
##########
@@ -312,6 +316,34 @@ object KyuubiArrowConverters extends SQLConfHelper with
Logging {
}
}
+ // the signature of function [[ArrowUtils.toArrowSchema]] is changed in
SPARK-41971 (since Spark
+ // 3.5)
+ private lazy val toArrowSchemaMethod = DynMethods.builder("toArrowSchema")
+ .impl( // for Spark 3.4 or previous
+ "org.apache.spark.sql.util.ArrowUtils",
+ classOf[StructType],
+ classOf[String])
+ .impl( // for Spark 3.5 or later
+ "org.apache.spark.sql.util.ArrowUtils",
+ classOf[StructType],
+ classOf[String],
+ classOf[Boolean])
+ .build()
+
+ /**
+ * this function uses reflective calls to the [[ArrowUtils.toArrowSchema]].
+ */
+ private def toArrowSchema(
+ schema: StructType,
+ timeZone: String,
+ errorOnDuplicatedFieldNames: Boolean): ArrowSchema = {
Review Comment:
Does this approach work?
```suggestion
errorOnDuplicatedFieldNames: JBoolean): ArrowSchema = {
```
--
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]