dcoliversun commented on code in PR #9009:
URL: https://github.com/apache/incubator-gluten/pull/9009#discussion_r2030844583
##########
backends-velox/src/test/scala/org/apache/gluten/execution/JsonFunctionsValidateSuite.scala:
##########
@@ -325,4 +325,39 @@ class JsonFunctionsValidateSuite extends
FunctionsValidateSuite {
}
}
}
+
+ test("json_object_keys function") {
+ withTempPath {
+ path =>
+ Seq[(String)](
+ (""""""),
+ ("""200"""),
+ ("""{}"""),
+ ("""{"key": 1}"""),
+ ("""{"key": "value", "key2": 2}"""),
+ ("""{"arrayKey": [1, 2, 3]}"""),
+ ("""{"key":[1,2,3,{"key":"value"},[1,2,3]]}"""),
+ ("""{"f1":"abc","f2":{"f3":"a", "f4":"b"}}"""),
+ ("""{"k1": [1, 2, {"key": 5}], "k2": {"key2": [1, 2]}}"""),
+ ("""[1, 2, 3]"""),
+ ("""{[1,2]}"""),
+ ("""{"key": 45, "random_string"}""")
+ )
+ .toDF("txt")
+ .write
+ .parquet(path.getCanonicalPath)
+
+
spark.read.parquet(path.getCanonicalPath).createOrReplaceTempView("tbl")
+
+ runQueryAndCompare("select txt, json_object_keys(txt) from tbl") {
+ checkSparkOperatorMatch[ProjectExecTransformer]
+ }
+
+ runQueryAndCompare(
+ "SELECT json_object_keys(null) " +
Review Comment:
Fine, I see other test with `select spark_function(null) from tbl` also. I
will submit other PR to fix, this case is ok
--
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]