xuzifu666 commented on code in PR #4908:
URL: https://github.com/apache/calcite/pull/4908#discussion_r3140873319
##########
arrow/src/test/java/org/apache/calcite/adapter/arrow/ArrowAdapterTest.java:
##########
@@ -803,24 +802,57 @@ static void initializeArrowState(@TempDir Path
sharedTempDir)
.explainContains(plan);
}
-
- @Disabled("join is not supported yet")
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-6299">[CALCITE-6299]
+ * Support JOIN in Arrow adapter</a>. */
@Test void testJoin() {
String sql = "select t1.\"intField\", t2.\"intField\" "
+ "from arrowdata t1 join arrowdata t2 on t1.\"intField\" =
t2.\"intField\"";
- String plan = "PLAN=EnumerableJoin(condition=[=($0, $4)],
joinType=[inner])\n"
- + " ArrowToEnumerableConverter\n"
- + " ArrowTableScan(table=[[ARROW, ARROWDATA]], fields=[[0, 1, 2,
3]])\n"
- + " ArrowToEnumerableConverter\n"
- + " ArrowTableScan(table=[[ARROW, ARROWDATA]], fields=[[0, 1, 2,
3]])\n\n";
- String result =
"intField=0\nintField=1\nintField=2\nintField=3\nintField=4\nintField=5\n";
+ String plan = "PLAN=EnumerableMergeJoin(condition=[=($0, $1)],
joinType=[inner])\n"
+ + " EnumerableSort(sort0=[$0], dir0=[ASC])\n"
+ + " ArrowToEnumerableConverter\n"
+ + " ArrowProject(intField=[$0])\n"
+ + " ArrowTableScan(table=[[ARROW, ARROWDATA]], fields=[[0, 1,
2, 3]])\n"
+ + " EnumerableSort(sort0=[$0], dir0=[ASC])\n"
+ + " ArrowToEnumerableConverter\n"
+ + " ArrowProject(intField=[$0])\n"
+ + " ArrowTableScan(table=[[ARROW, ARROWDATA]], fields=[[0, 1,
2, 3]])\n\n";
+ String result = "intField=0; intField=0\n"
+ + "intField=1; intField=1\n"
+ + "intField=2; intField=2\n"
+ + "intField=3; intField=3\n"
+ + "intField=4; intField=4\n"
+ + "intField=5; intField=5\n";
CalciteAssert.that()
.with(arrow)
.query(sql)
- .limit(1)
+ .limit(6)
Review Comment:
The output was long, so I used a limit, but limit shouldn't be needed here.
I removed limit in test case accordingly.
--
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]