@@ -83,7 +83,7 @@ FlatMap wrap3(0, 1, 2, 3)
83
83
## Support for unnest_~ calls
84
84
## --------------------------
85
85
86
- # Rewrite possible for `unnset_array `
86
+ # Rewrite possible for `unnest_array `
87
87
# Example SQL: select unnest(array[f1]) from t1 where f1 = 5;
88
88
apply pipeline = flat_map_elimination
89
89
FlatMap unnest_array ({5 })
@@ -101,15 +101,15 @@ FlatMap unnest_list([5])
101
101
Map (5 )
102
102
Get t0
103
103
104
- # Rewrite not possible: unnest_array(-) argument is not resuced
104
+ # Rewrite not possible: unnest_array(-) argument is not reduced to a literal
105
105
apply pipeline = flat_map_elimination
106
106
FlatMap unnest_array (array [5 ])
107
107
Get t0
108
108
- - - -
109
109
FlatMap unnest_array (array [5 ])
110
110
Get t0
111
111
112
- # Rewrite not possible: unnest_list(-) argument is not resuced
112
+ # Rewrite not possible: unnest_list(-) argument is not reduced to a literal
113
113
apply pipeline = flat_map_elimination
114
114
FlatMap unnest_list (list [5 ])
115
115
Get t0
@@ -119,16 +119,37 @@ FlatMap unnest_list(list[5])
119
119
120
120
# Rewrite not possible: unnest_array(-) argument is not a singleton
121
121
apply pipeline = flat_map_elimination
122
+ FlatMap unnest_array ({5 , 6 })
123
+ Get t0
124
+ - - - -
125
+ FlatMap unnest_array ({5 , 6 })
126
+ Get t0
127
+
128
+ # Rewrite not possible: unnest_list(-) argument is not a singleton
129
+ apply pipeline = flat_map_elimination
122
130
FlatMap unnest_list ([5 , 6 ])
123
131
Get t0
124
132
- - - -
125
133
FlatMap unnest_list ([5 , 6 ])
126
134
Get t0
127
135
128
- # Rewrite not possible: unnest_list(-) argument is not a singleton
136
+ # generate_series can produce 0, 1, or more rows, based on its arguments
129
137
apply pipeline = flat_map_elimination
130
- FlatMap unnest_list ( list [ 5 ] )
138
+ FlatMap generate_series ( 5 , 2 , 1 )
131
139
Get t0
132
140
- - - -
133
- FlatMap unnest_list (list [5 ])
141
+ Constant < empty >
142
+
143
+ apply pipeline = flat_map_elimination
144
+ FlatMap generate_series (5 , 5 , 1 )
145
+ Get t0
146
+ - - - -
147
+ Map (5 )
134
148
Get t0
149
+
150
+ apply pipeline = flat_map_elimination
151
+ FlatMap generate_series (5 , 6 , 1 )
152
+ Get t0
153
+ - - - -
154
+ FlatMap generate_series (5 , 6 , 1 )
155
+ Get
0 commit comments