uros-b commented on code in PR #56447:
URL: https://github.com/apache/spark/pull/56447#discussion_r3444208136
##########
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:
Do we have NULL-value tests for complex columns? It seems that
getColumnValue returns the null default for a null complex cell and
toJdbcObject correctly guards value == null; but do we have tests asserting
getObject/getString/wasNull for a NULL ARRAY/MAP/STRUCT?
--
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]