Skip to content

Commit d384e4d

Browse files
Restore old method for DQE
1 parent 734f916 commit d384e4d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

datafusion/physical-expr-common/src/sort_expr.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,26 @@ impl PhysicalSortExpr {
181181
.map_or(true, |opts| self.options.descending == opts.descending)
182182
}
183183
}
184+
185+
/// Returns a [`Display`]able list of `PhysicalSortExpr`.
186+
pub fn format_list(input: &[PhysicalSortExpr]) -> impl Display + '_ {
187+
struct DisplayableList<'a>(&'a [PhysicalSortExpr]);
188+
impl<'a> Display for DisplayableList<'a> {
189+
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
190+
let mut first = true;
191+
for sort_expr in self.0 {
192+
if first {
193+
first = false;
194+
} else {
195+
write!(f, ",")?;
196+
}
197+
write!(f, "{}", sort_expr)?;
198+
}
199+
Ok(())
200+
}
201+
}
202+
DisplayableList(input)
203+
}
184204
}
185205

186206
/// Represents sort requirement associated with a plan

0 commit comments

Comments
 (0)