jinxing64 commented on a change in pull request #1694: [CALCITE-2935] Add 
support BOOL_AND/BOOL_OR Aggregate Function
URL: https://github.com/apache/calcite/pull/1694#discussion_r362160755
 
 

 ##########
 File path: 
core/src/test/java/org/apache/calcite/sql/test/SqlOperatorBaseTest.java
 ##########
 @@ -8724,6 +8724,64 @@ protected void checkAggType(SqlTester tester, String 
expr, String type) {
         0d);
   }
 
+  @Test public void testBoolAndFunc() {
+    tester.setFor(SqlStdOperatorTable.BOOL_AND, VM_EXPAND);
+
+    tester.checkFails(
+        "bool_and(^*^)",
+        "Unknown identifier '\\*'",
+        false);
+    tester.checkType("bool_and(true)", "BOOLEAN");
+    tester.checkFails("^bool_and(1)^",
+        "Cannot apply 'BOOL_AND' to arguments of type 
'BOOL_AND\\(<INTEGER>\\)'\\. "
+            + "Supported form\\(s\\): 'BOOL_AND\\(<BOOLEAN>\\)'",
+        false);
+    tester.checkFails(
+        "^bool_and()^",
+        "Invalid number of arguments to function 'BOOL_AND'. Was expecting 1 
arguments",
+        false);
+    tester.checkFails(
+        "^bool_and(true, true)^",
+        "Invalid number of arguments to function 'BOOL_AND'. Was expecting 1 
arguments",
+        false);
+
+    final String[] values1 = {"true", "true", "null"};
 
 Review comment:
   Shall we add a test of `values = {null}` ?

----------------------------------------------------------------
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

Reply via email to