masonh22 commented on code in PR #25577:
URL: https://github.com/apache/datafusion/pull/25577#discussion_r4082916175


##########
datafusion/optimizer/src/eliminate_limit.rs:
##########
@@ -77,8 +83,9 @@ impl OptimizerRule for EliminateLimit {
                 } else if matches!(limit.get_skip_type()?, 
SkipType::Literal(0)) {
                     // If fetch is `None` and skip is 0, then Limit takes no 
effect and
                     // we can remove it. Its input also can be Limit, so we 
should apply again.
-                    #[expect(clippy::used_underscore_binding)]
-                    return self.rewrite(Arc::unwrap_or_clone(limit.input), 
_config);
+                    let mut res = 
Self::rewrite_inner(Arc::unwrap_or_clone(limit.input))?;

Review Comment:
   Hmmm, good question.  We shouldn't need to recurse here since the mechanism 
that actually calls the optimizer rules should handle that.  Also, the apply 
order is `BottomUp` for this so it should've been called on the child already.  
So I think this might be unnecessary.  Let me try removing it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to