jonathanc-n commented on code in PR #20799:
URL: https://github.com/apache/datafusion/pull/20799#discussion_r2902413428
##########
datafusion/physical-plan/src/joins/utils.rs:
##########
@@ -2939,4 +2940,19 @@ mod tests {
Ok(())
}
-}
+ #[test]
Review Comment:
I created a test for this for `sqllogictest`s :
```
statement ok
CREATE TABLE t1(a INT, b INT) AS VALUES
(NULL, 1), (NULL, 2), (NULL, 3), (NULL, 4), (NULL, 5);
statement ok
CREATE TABLE t2(c INT) AS VALUES (1), (2);
# This query panicked before the fix: the ORDER BY forces a SortExec,
# the LIMIT gets pushed into SortExec.fetch, and the HashJoinExec
# calls partition_statistics() on the SortExec child during execution.
query II
SELECT sub.a, sub.b FROM (
SELECT * FROM t1 ORDER BY b LIMIT 1
) sub
JOIN t2 ON sub.a = t2.c;
----
statement ok
DROP TABLE t1;
statement ok
DROP TABLE t2;
```
i verified it reproduces the bug
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]