@@ -196,9 +196,15 @@ pub trait UserDefinedLogicalNode: fmt::Debug + Send + Sync {
196196 fn dyn_eq ( & self , other : & dyn UserDefinedLogicalNode ) -> bool ;
197197 fn dyn_ord ( & self , other : & dyn UserDefinedLogicalNode ) -> Option < Ordering > ;
198198
199- /// Indicates to the optimizer if its safe to push a limit down past
200- /// this extension node
201- fn allows_limit_to_inputs ( & self ) -> bool ;
199+ /// Returns `true` if a limit can be safely pushed down through this
200+ /// `UserDefinedLogicalNode` node.
201+ ///
202+ /// If this method returns `true`, and the query plan contains a limit at
203+ /// the output of this node, DataFusion will push the limit to the input
204+ /// of this node.
205+ fn supports_limit_pushdown ( & self ) -> bool {
206+ false
207+ }
202208}
203209
204210impl Hash for dyn UserDefinedLogicalNode {
@@ -300,9 +306,15 @@ pub trait UserDefinedLogicalNodeCore:
300306 None
301307 }
302308
303- /// Indicates to the optimizer if its safe to push a limit down past
304- /// this extension node
305- fn allows_limit_to_inputs ( & self ) -> bool ;
309+ /// Returns `true` if a limit can be safely pushed down through this
310+ /// `UserDefinedLogicalNode` node.
311+ ///
312+ /// If this method returns `true`, and the query plan contains a limit at
313+ /// the output of this node, DataFusion will push the limit to the input
314+ /// of this node.
315+ fn supports_limit_pushdown ( & self ) -> bool {
316+ false // Disallow limit push-down by default
317+ }
306318}
307319
308320/// Automatically derive UserDefinedLogicalNode to `UserDefinedLogicalNode`
@@ -370,8 +382,8 @@ impl<T: UserDefinedLogicalNodeCore> UserDefinedLogicalNode for T {
370382 . and_then ( |other| self . partial_cmp ( other) )
371383 }
372384
373- fn allows_limit_to_inputs ( & self ) -> bool {
374- self . allows_limit_to_inputs ( )
385+ fn supports_limit_pushdown ( & self ) -> bool {
386+ self . supports_limit_pushdown ( )
375387 }
376388}
377389
0 commit comments