@@ -158,24 +158,6 @@ pub trait Memo<T: NodeType>: 'static + Send + Sync {
158
158
) -> Result < ArcPlanNode < T > > {
159
159
get_best_group_binding_inner ( self , group_id, & mut post_process)
160
160
}
161
-
162
- /// Get all bindings of a predicate group. Will panic if the group contains more than one
163
- /// bindings. Note that we are currently in the refactor process of having predicates as a
164
- /// separate entity. If the representation stores predicates in the rel node children, the
165
- /// repr should use this function to get the predicate binding. Otherwise, use `ger_pred`
166
- /// for those predicates stored within the `predicates` field.
167
- ///
168
- /// TODO: this can be removed after the predicate refactor, unless someone comes up with a
169
- /// plan representation that embeds predicates in the plan node.
170
- fn get_predicate_binding ( & self , group_id : GroupId ) -> Option < ArcPlanNode < T > > {
171
- get_predicate_binding_group_inner ( self , group_id, true )
172
- }
173
-
174
- /// Get all bindings of a predicate group. Returns None if the group contains zero or more than
175
- /// one bindings.
176
- fn try_get_predicate_binding ( & self , group_id : GroupId ) -> Option < ArcPlanNode < T > > {
177
- get_predicate_binding_group_inner ( self , group_id, false )
178
- }
179
161
}
180
162
181
163
fn get_best_group_binding_inner < M : Memo < T > + ?Sized , T : NodeType > (
@@ -204,51 +186,6 @@ fn get_best_group_binding_inner<M: Memo<T> + ?Sized, T: NodeType>(
204
186
bail ! ( "no best group binding for group {}" , group_id)
205
187
}
206
188
207
- fn get_predicate_binding_expr_inner < M : Memo < T > + ?Sized , T : NodeType > (
208
- this : & M ,
209
- expr_id : ExprId ,
210
- panic_on_invalid_group : bool ,
211
- ) -> Option < ArcPlanNode < T > > {
212
- let expr = this. get_expr_memoed ( expr_id) ;
213
- let mut children = Vec :: with_capacity ( expr. children . len ( ) ) ;
214
- for child in expr. children . iter ( ) {
215
- if let Some ( child) = get_predicate_binding_group_inner ( this, * child, panic_on_invalid_group)
216
- {
217
- children. push ( PlanNodeOrGroup :: PlanNode ( child) ) ;
218
- } else {
219
- return None ;
220
- }
221
- }
222
- Some ( Arc :: new ( PlanNode {
223
- typ : expr. typ . clone ( ) ,
224
- children,
225
- predicates : expr. predicates . iter ( ) . map ( |x| this. get_pred ( * x) ) . collect ( ) ,
226
- } ) )
227
- }
228
-
229
- fn get_predicate_binding_group_inner < M : Memo < T > + ?Sized , T : NodeType > (
230
- this : & M ,
231
- group_id : GroupId ,
232
- panic_on_invalid_group : bool ,
233
- ) -> Option < ArcPlanNode < T > > {
234
- let exprs = this. get_all_exprs_in_group ( group_id) ;
235
- match exprs. len ( ) {
236
- 0 => None ,
237
- 1 => get_predicate_binding_expr_inner (
238
- this,
239
- exprs. first ( ) . copied ( ) . unwrap ( ) ,
240
- panic_on_invalid_group,
241
- ) ,
242
- len => {
243
- if panic_on_invalid_group {
244
- panic ! ( "group {group_id} has {len} expressions" )
245
- } else {
246
- None
247
- }
248
- }
249
- }
250
- }
251
-
252
189
/// A naive, simple, and unoptimized memo table implementation.
253
190
pub struct NaiveMemo < T : NodeType > {
254
191
// Source of truth.
0 commit comments