Convert a DataFusion [`Expr`] to [`ast::Expr`] This function is the opposite of [`SqlToRel::sql_to_expr`] and can be used to, among other things, convert [`Expr`]s to SQL strings. Such strings could be used to pass filters or other expressions to another SQL engine. # Errors Throws an error if [`Expr`] can not be represented by an [`ast::Expr`] # See Also [`Unparser`] for more control over th
(expr: &Expr)
| 83 | /// [`plan_to_sql`]: crate::unparser::plan_to_sql |
| 84 | /// [`LogicalPlan`]: datafusion_expr::logical_plan::LogicalPlan |
| 85 | pub fn expr_to_sql(expr: &Expr) -> Result<ast::Expr> { |
| 86 | let unparser = Unparser::default(); |
| 87 | unparser.expr_to_sql(expr) |
| 88 | } |
| 89 | |
| 90 | const LOWEST: &BinaryOperator = &BinaryOperator::Or; |
| 91 | // Closest precedence we have to IS operator is BitwiseAnd (any other) in PG docs |
searching dependent graphs…