j1wonpark commented on code in PR #56447:
URL: https://github.com/apache/spark/pull/56447#discussion_r3444922987


##########
sql/connect/client/jdbc/src/main/scala/org/apache/spark/sql/connect/client/jdbc/util/JdbcTypeUtils.scala:
##########
@@ -149,4 +167,38 @@ private[jdbc] object JdbcTypeUtils {
     case _: NumericType => 10
     case _ => null
   }
+
+  /**
+   * Converts a value materialized by the Spark Connect client (Scala Seq / 
Map / Row for
+   * complex types) into the corresponding standard JDBC object, recursively:
+   * ARRAY -> java.sql.Array, STRUCT -> java.sql.Struct, MAP -> java.util.Map. 
Scalar values
+   * are returned as is.
+   */
+  def toJdbcObject(value: Any, dataType: DataType): AnyRef = {
+    if (value == null) {
+      null

Review Comment:
   Good catch — added a dedicated `"get complex types with null"` test 
asserting `getObject` / `getString` / `getArray` all return `null` and 
`wasNull` is `true` for NULL `ARRAY` / `MAP` / `STRUCT` columns. Pushed in 
1ffbcfd046a.



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