Skip to content

Commit 3337d66

Browse files
committed
Reorganize to match guard
Signed-off-by: Austin Liu <austin362667@gmail.com>
1 parent 0872fa7 commit 3337d66

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

datafusion/optimizer/src/push_down_limit.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,16 +153,15 @@ impl OptimizerRule for PushDownLimit {
153153
subquery_alias.input = Arc::new(new_limit);
154154
Ok(Transformed::yes(LogicalPlan::SubqueryAlias(subquery_alias)))
155155
}
156-
LogicalPlan::Extension(extension_plan) => {
157-
if !extension_plan.node.allows_limit_to_inputs() {
158-
// If push down is not allowed, keep the original limit
159-
return original_limit(
160-
skip,
161-
fetch,
162-
LogicalPlan::Extension(extension_plan),
163-
);
164-
}
165-
156+
LogicalPlan::Extension(extension_plan)
157+
if !extension_plan.node.allows_limit_to_inputs() =>
158+
{
159+
// If push down is not allowed, keep the original limit
160+
original_limit(skip, fetch, LogicalPlan::Extension(extension_plan))
161+
}
162+
LogicalPlan::Extension(extension_plan)
163+
if extension_plan.node.allows_limit_to_inputs() =>
164+
{
166165
let new_children = extension_plan
167166
.node
168167
.inputs()

0 commit comments

Comments
 (0)