dongjoon-hyun commented on a change in pull request #27759: [SPARK-31008][SQL]
Support json_array_length function
URL: https://github.com/apache/spark/pull/27759#discussion_r403770485
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/JsonExpressionsSuite.scala
##########
@@ -790,4 +790,27 @@ class JsonExpressionsSuite extends SparkFunSuite with
ExpressionEvalHelper with
checkDecimalInfer(_, """struct<d:decimal(7,3)>""")
}
}
+
+ test("Length of JSON array") {
+ Seq(
+ ("""""", null),
+ ("""[1,2,3]""", 3),
+ ("""[]""", 0),
+ ("""[[1],[2,3],[]]""", 3),
Review comment:
This is different from the example I gave you. Do you have any reason to
prefer `"""` here? Usually, Apache Spark prefer to use a simple form `"` than
`"""`.
- https://github.com/apache/spark/pull/27759#discussion_r400594807
```
Seq(
("", null),
("[]", 0),
("[1,2,3]", 3),
("[[1],[2,3],[]]", 3),
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]