haohuaijin commented on code in PR #8485:
URL: https://github.com/apache/arrow-datafusion/pull/8485#discussion_r1422133299


##########
datafusion/sqllogictest/test_files/join.slt:
##########
@@ -594,3 +594,39 @@ drop table IF EXISTS full_join_test;
 # batch size
 statement ok
 set datafusion.execution.batch_size = 8192;
+
+# related to: https://github.com/apache/arrow-datafusion/issues/8374
+statement ok
+CREATE TABLE t1(a text, b int) AS VALUES ('Alice', 50), ('Alice', 100);
+
+statement ok
+CREATE TABLE t2(a text, b int) AS VALUES ('Alice', 2), ('Alice', 1);
+
+# the current query results are incorrect, becuase the query was incorrectly 
rewritten as:
+# SELECT t1.a, t1.b FROM t1 JOIN t2 ON t1.a = t2.a ORDER BY t1.a, t1.b;
+# after https://github.com/apache/arrow-datafusion/issues/8374 fixed, the 
result should be:
+# Alice 50
+# Alice 100
+# Alice 50
+# Alice 100

Review Comment:
   the previous comment may lead to misunderstandings, I add more comment.
   the correct result of query
   ```sql
   SELECT t1.a, t1.b FROM t1 JOIN t2 ON t1.a = t2.a ORDER BY t1.a, t2.b;
   ```
   should equal to the first two column of query
   ```sql
   SELECT t1.a, t1.b, t2.a, t2.b FROM t1 JOIN t2 ON t1.a = t2.a ORDER BY t1.a, 
t2.b;
   ```



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