File tree 1 file changed +21
-0
lines changed
datafusion/sqllogictest/test_files
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,25 @@ logical_plan
60
60
05)--------Projection: v.column2 AS unnest(v.column2), v.column1
61
61
06)----------TableScan: v projection=[column1, column2]
62
62
63
+ query II
64
+ select uc2, column1 from (select unnest(column2) as uc2, column1 from v) where uc2 > 3 AND column1 = 2;
65
+ ----
66
+ 4 2
67
+ 5 2
68
+
69
+ # Could push the filter (column1 = 2) down below unnest
70
+ # https://github.com/apache/datafusion/issues/11016
71
+ query TT
72
+ explain select uc2, column1 from (select unnest(column2) as uc2, column1 from v) where uc2 > 3 AND column1 = 2;
73
+ ----
74
+ logical_plan
75
+ 01)Projection: unnest(v.column2) AS uc2, v.column1
76
+ 02)--Filter: unnest(v.column2) > Int64(3) AND v.column1 = Int64(2)
77
+ 03)----Unnest: lists[unnest(v.column2)] structs[]
78
+ 04)------Projection: v.column2 AS unnest(v.column2), v.column1
79
+ 05)--------TableScan: v projection=[column1, column2]
80
+
81
+
63
82
statement ok
64
83
drop table v;
65
84
@@ -82,5 +101,7 @@ logical_plan
82
101
04)------Projection: d.column1, d.column2 AS unnest(d.column2)
83
102
05)--------TableScan: d projection=[column1, column2]
84
103
104
+
105
+
85
106
statement ok
86
107
drop table d;
You can’t perform that action at this time.
0 commit comments