pan3793 commented on code in PR #6786:
URL: https://github.com/apache/kyuubi/pull/6786#discussion_r1823817903


##########
kyuubi-common/src/main/scala/org/apache/kyuubi/engine/result/TColumnGenerator.scala:
##########
@@ -33,16 +33,18 @@ trait TColumnGenerator[RowT] extends 
TRowSetColumnGetter[RowT] {
     val rowSize = rows.length
     val ret = new JArrayList[T](rowSize)
     val nulls = new JBitSet()
+    val isConvertFuncDefined = Option(convertFunc).isDefined
     var idx = 0
     rows.foreach { row =>
       val isNull = isColumnNullAt(row, ordinal)
       if (isNull) {
         nulls.set(idx, true)
         ret.add(defaultVal)
       } else {
-        val value = Option(convertFunc) match {
-          case Some(f) => f(row, ordinal)
-          case _ => getColumnAs[T](row, ordinal)
+        val value = if (isConvertFuncDefined) {
+          convertFunc(row, ordinal)
+        } else {
+          getColumnAs[T](row, ordinal)

Review Comment:
   let's use a simple way
   ```
   if (convertFunc == null) {
     ...
   } else {
     ...
   }
   ```



-- 
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: notifications-unsubscr...@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@kyuubi.apache.org
For additional commands, e-mail: notifications-h...@kyuubi.apache.org

Reply via email to