alamb commented on pull request #9338:
URL: https://github.com/apache/arrow/pull/9338#issuecomment-771572317
@Dandandan I think that idea looks good. What do you think about the
following slightly more general (but possibly less efficient) version that
takes an `impl IntoIterator` instead:
```
pub fn sort(&self, expr: impl IntoIterator<Item=Expr>) -> Result<Self> {
Ok(Self::from(&LogicalPlan::Sort {
expr: expr.into_iter().collect(),
input: Arc::new(self.plan.clone()),
}))
}
```
I am not sure how much extra work, if any, that would require for
`Vec<Expr>` but it would allow creating plans with things like values in a map:
```
let my_map: BTreeMap<&str, Expr> = ....;
builder = builder.sort(my_map.values())
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]