bowenliang123 commented on code in PR #4246:
URL: https://github.com/apache/kyuubi/pull/4246#discussion_r1101408795


##########
externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/schema/SchemaHelper.scala:
##########
@@ -41,6 +41,24 @@ object SchemaHelper {
    */
   final val YEAR_MONTH_INTERVAL = "YearMonthIntervalType"
 
+  /**
+   * SPARK-7768: UDT API has been public since Spark 3.2.0.
+   * Here we distinguish the UDT if the datatype is subClass of UserDefinedType
+   * that is available in public since Spark 3.2.0
+   */
+  final private val isUserDefinedType = (dt: DataType) => {
+    val dataType = "org.apache.spark.sql.types.DataType"
+    // Canonical name of Spark 3.2.0 DataType UserDefinedType.
+    val userDefinedType = "org.apache.spark.sql.types.UserDefinedType"
+
+    var curClass: Class[_] = dt.getClass

Review Comment:
   ```suggestion
       var curClass: Class[_] = dt.getClass
   ```
   The variable name `currentClass` is preferred as `cur` is not a common 
abbreviation for the word `current`.



-- 
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