ganeshashree commented on code in PR #58005:
URL: https://github.com/apache/spark/pull/58005#discussion_r3849625377
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/jsonExpressions.scala:
##########
@@ -1201,7 +1211,429 @@ object JsonQuery {
}
/**
- * Converts an json input string to a [[StructType]], [[ArrayType]] or
[[MapType]]
+ * Behavior of `JSON_ARRAY`'s `ON NULL` clause: what to do with NULL elements
in the array.
+ */
+sealed trait JsonConstructorNullBehavior
+object JsonConstructorNullBehavior {
+ /** Include NULL elements as JSON `null` values. */
+ case object Null extends JsonConstructorNullBehavior
+ /** Omit NULL elements from the array. */
+ case object Absent extends JsonConstructorNullBehavior
+}
+
+/**
+ * Marker for expressions whose result is JSON text and therefore carry an
implicit SQL/JSON
+ * `FORMAT JSON`: when such an expression appears as an argument of a JSON
constructor (e.g.
+ * `JSON_ARRAY`), its value is spliced in verbatim rather than quoted as a
JSON string, so
+ * `JSON_ARRAY(JSON_ARRAY(1))` yields `[[1]]`, not `[["[1]"]]`. Crucially, the
constructor freezes
Review Comment:
Done.
--
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]