Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
PHILO-HE committed Aug 6, 2024
1 parent 87bd24c commit 61d4df4
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,20 +263,28 @@ abstract class ScalarFunctionsValidateSuite extends FunctionsValidateTest {
}
}

test("Test get_json_object datatab function") {
test("get_json_object") {
runQueryAndCompare(
"SELECT get_json_object(string_field1, '$.a') " +
"from datatab limit 1;") {
checkGlutenOperatorMatch[ProjectExecTransformer]
}
}

test("Test get_json_object lineitem function") {
runQueryAndCompare(
"SELECT l_orderkey, get_json_object('{\"a\":\"b\"}', '$.a') " +
"from lineitem limit 1;") {
checkGlutenOperatorMatch[ProjectExecTransformer]
}

// Invalid UTF-8 encoding.
spark.sql(
"CREATE TABLE t USING parquet SELECT concat('{\"a\": 2, \"'," +
" string(X'80'), '\": 3, \"c\": 100}') AS c1")
withTable("t") {
runQueryAndCompare("SELECT get_json_object(c1, '$.c') FROM t;") {
checkGlutenOperatorMatch[ProjectExecTransformer]
}
}
}

ignore("json_array_length") {
Expand Down

0 comments on commit 61d4df4

Please sign in to comment.