xudong963 commented on issue #1195:
URL:
https://github.com/apache/arrow-datafusion/issues/1195#issuecomment-954015453
Thanks, @Jimexist @alamb
How about adding an error hint in src/sql/planner.rs
```rust
/// Wrap the logical in a sort
fn order_by(
&self,
plan: LogicalPlan,
order_by: &[OrderByExpr],
) -> Result<LogicalPlan> {
if order_by.is_empty() {
return Ok(plan);
}
let order_by_rex = order_by
.iter()
.map(|e| {
match e.clone().expr {
SQLExpr::Value(value) =>
Err(DataFusionError::Plan(format!("order by {:?} err", value))),
_ => self.order_by_to_sort_expr(e, plan.schema())
}
})
.collect::<Result<Vec<_>>>()?;
LogicalPlanBuilder::from(plan).sort(order_by_rex)?.build()
}
```
```shell
> select '1' as c order by null;
Plan("order by Null err")
> select '1' as c order by 'foo';
Plan("order by SingleQuotedString(\"foo\") err")
> select '1' as c order by c;
+---+
| c |
+---+
| 1 |
+---+
1 row in set. Query took 0.005 seconds.
```
--
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]