This is an automated email from the ASF dual-hosted git repository.

jayzhan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new 1e7c38b4f0 Minor: add test for pushdown past unnest (#11017)
1e7c38b4f0 is described below

commit 1e7c38b4f0dfbd77c188a6085400af76d22dbe30
Author: Andrew Lamb <[email protected]>
AuthorDate: Wed Jun 19 20:38:35 2024 -0400

    Minor: add test for pushdown past unnest (#11017)
---
 .../sqllogictest/test_files/push_down_filter.slt    | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/datafusion/sqllogictest/test_files/push_down_filter.slt 
b/datafusion/sqllogictest/test_files/push_down_filter.slt
index 368243f966..5029ab170a 100644
--- a/datafusion/sqllogictest/test_files/push_down_filter.slt
+++ b/datafusion/sqllogictest/test_files/push_down_filter.slt
@@ -60,6 +60,25 @@ logical_plan
 05)--------Projection: v.column2 AS unnest(v.column2), v.column1
 06)----------TableScan: v projection=[column1, column2]
 
+query II
+select uc2, column1 from  (select unnest(column2) as uc2, column1 from v) 
where uc2 > 3 AND column1 = 2;
+----
+4 2
+5 2
+
+# Could push the filter (column1 = 2) down below unnest
+# https://github.com/apache/datafusion/issues/11016
+query TT
+explain select uc2, column1 from  (select unnest(column2) as uc2, column1 from 
v) where uc2 > 3 AND column1 = 2;
+----
+logical_plan
+01)Projection: unnest(v.column2) AS uc2, v.column1
+02)--Filter: unnest(v.column2) > Int64(3) AND v.column1 = Int64(2)
+03)----Unnest: lists[unnest(v.column2)] structs[]
+04)------Projection: v.column2 AS unnest(v.column2), v.column1
+05)--------TableScan: v projection=[column1, column2]
+
+
 statement ok
 drop table v;
 
@@ -82,5 +101,7 @@ logical_plan
 04)------Projection: d.column1, d.column2 AS unnest(d.column2)
 05)--------TableScan: d projection=[column1, column2]
 
+
+
 statement ok
 drop table d;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to