wuchong commented on a change in pull request #11174: [FLINK-16199][sql] 
Support IS JSON predicate for blink planner
URL: https://github.com/apache/flink/pull/11174#discussion_r385529970
 
 

 ##########
 File path: 
flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/expressions/ScalarFunctionsTest.scala
 ##########
 @@ -4195,4 +4195,24 @@ class ScalarFunctionsTest extends ScalarTypesTestBase {
       "f55=f57",
       "true")
   }
+
+  @Test
+  def testIsJSONPredicates(): Unit = {
+    testSqlApi("'{}' is json value", "true")
+    testSqlApi("'{]' is json value", "false")
+    testSqlApi("'{}' is json object", "true")
+    testSqlApi("'[]' is json object", "false")
+    testSqlApi("'{}' is json array", "false")
+    testSqlApi("'[]' is json array", "true")
+    testSqlApi("'100' is json scalar", "true")
+    testSqlApi("'[]' is json scalar", "false")
+    testSqlApi("'{}' is not json value", "false")
+    testSqlApi("'{]' is not json value", "true")
+    testSqlApi("'{}' is not json object", "false")
+    testSqlApi("'[]' is not json object", "true")
+    testSqlApi("'{}' is not json array", "true")
+    testSqlApi("'[]' is not json array", "false")
+    testSqlApi("'100' is not json scalar", "false")
+    testSqlApi("'[]' is not json scalar", "true")
 
 Review comment:
   Could you add some tests on a column reference? Currently, all the testing 
data is char. 
   Please also test on non-string columns.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to