mihaibudiu commented on code in PR #4032:
URL: https://github.com/apache/calcite/pull/4032#discussion_r1829678642


##########
arrow/src/test/java/org/apache/calcite/adapter/arrow/ArrowAdapterDataTypesTest.java:
##########
@@ -176,4 +176,94 @@ static void initializeArrowState(@TempDir Path 
sharedTempDir)
         .returns(result)
         .explainContains(plan);
   }
+
+  @Test void testBooleanProject() {
+    String sql = "select \"booleanField\" from arrowdatatype";
+    String plan = "PLAN=ArrowToEnumerableConverter\n"
+        + "  ArrowProject(booleanField=[$7])\n"
+        + "    ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 
2, 3, 4, 5, 6, 7, 8, 9]])\n\n";
+    String result = 
"booleanField=null\nbooleanField=true\nbooleanField=false\n";
+    CalciteAssert.that()
+        .with(arrow)
+        .query(sql)
+        .limit(3)
+        .returns(result)
+        .explainContains(plan);
+  }
+
+  /** Test case for
+   * <a 
href="https://issues.apache.org/jira/browse/CALCITE-6638";>[CALCITE-6638]
+   * Arrow adapter should support IS FALSE Operator and IS TRUE Operator</a>. 
*/
+  @Test void testArrowProjectWithIsTrueFilter() {
+    String sql = "select \"booleanField\"\n"
+        + "from arrowdatatype\n"
+        + "where \"booleanField\" is true";
+    String plan = "PLAN=ArrowToEnumerableConverter\n"
+        + "  ArrowProject(booleanField=[$7])\n"
+        + "    ArrowFilter(condition=[$7])\n"
+        + "      ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 
2, 3, 4, 5, 6, 7, 8, 9]])\n\n";
+    String result = "booleanField=true\nbooleanField=true\n";
+
+    CalciteAssert.that()
+        .with(arrow)
+        .query(sql)
+        .limit(2)
+        .returns(result)
+        .explainContains(plan);
+  }
+
+  @Test void testArrowProjectFieldsWithNotFilter() {
+    String sql = "select \"booleanField\"\n"
+        + "from arrowdatatype\n"
+        + "where \"booleanField\" is false";
+    String plan = "PLAN=ArrowToEnumerableConverter\n"
+        + "  ArrowProject(booleanField=[$7])\n"
+        + "    ArrowFilter(condition=[NOT($7)])\n"
+        + "      ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1, 
2, 3, 4, 5, 6, 7, 8, 9]])\n\n";
+    String result = "booleanField=false\nbooleanField=false\n";

Review Comment:
   So there are three rows, with values 'true', 'false', and 'null' for this 
field?
   The query is `SELECT booleanField from table`, so how can it return two rows 
with value `false` if there is only one?



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

Reply via email to