Prints a [`PhysicalExpr`] in a SQL-like format # Example ``` # // The boilerplate needed to create a `PhysicalExpr` for the example use std::collections::HashMap; # use std::fmt::Formatter; # use std::sync::Arc; # use arrow::array::RecordBatch; # use arrow::datatypes::{DataType, Field, FieldRef, Schema}; # use datafusion_common::Result; # use datafusion_expr_common::columnar_value::ColumnarValue;
(expr: &dyn PhysicalExpr)
| 615 | /// ); |
| 616 | /// ``` |
| 617 | pub fn fmt_sql(expr: &dyn PhysicalExpr) -> impl Display + '_ { |
| 618 | struct Wrapper<'a> { |
| 619 | expr: &'a dyn PhysicalExpr, |
| 620 | } |
| 621 | |
| 622 | impl Display for Wrapper<'_> { |
| 623 | fn fmt(&self, f: &mut Formatter) -> fmt::Result { |
| 624 | self.expr.fmt_sql(f)?; |
| 625 | Ok(()) |
| 626 | } |
| 627 | } |
| 628 | |
| 629 | Wrapper { expr } |
| 630 | } |
| 631 | |
| 632 | /// Take a snapshot of the given `PhysicalExpr` if it is dynamic. |
| 633 | /// |
no outgoing calls
searching dependent graphs…