Skip to content

Commit f998b1a

Browse files
committed
change unique_exprs conditional to an assertion
1 parent 77308cc commit f998b1a

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

datafusion/optimizer/src/eliminate_duplicated_expr.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,10 @@ impl OptimizerRule for EliminateDuplicatedExpr {
108108
Transformed::no
109109
};
110110

111-
if unique_exprs.is_empty() {
112-
return if sort.fetch.is_some() {
113-
Ok(Transformed::no(LogicalPlan::Sort(Sort {
114-
expr: unique_exprs,
115-
input: sort.input,
116-
fetch: sort.fetch,
117-
})))
118-
} else {
119-
Ok(Transformed::yes(sort.input.as_ref().clone()))
120-
};
121-
}
111+
assert!(
112+
!unique_exprs.is_empty(),
113+
"FD pruning unexpectedly removed all ORDER BY expressions"
114+
);
122115

123116
Ok(transformed(LogicalPlan::Sort(Sort {
124117
expr: unique_exprs,

0 commit comments

Comments
 (0)