MCPcopy Create free account
hub / github.com/apache/datafusion / convert_bound

Method convert_bound

datafusion/sql/src/unparser/expr.rs:871–908  ·  view source on GitHub ↗
(
        &self,
        bound: &datafusion_expr::window_frame::WindowFrameBound,
    )

Source from the content-addressed store, hash-verified

869 }
870
871 fn convert_bound(
872 &self,
873 bound: &datafusion_expr::window_frame::WindowFrameBound,
874 ) -> Result<ast::WindowFrameBound> {
875 match bound {
876 datafusion_expr::window_frame::WindowFrameBound::Preceding(val) => {
877 Ok(ast::WindowFrameBound::Preceding({
878 let val = self.scalar_to_sql(val)?;
879 if let ast::Expr::Value(ValueWithSpan {
880 value: ast::Value::Null,
881 span: _,
882 }) = &val
883 {
884 None
885 } else {
886 Some(Box::new(val))
887 }
888 }))
889 }
890 datafusion_expr::window_frame::WindowFrameBound::Following(val) => {
891 Ok(ast::WindowFrameBound::Following({
892 let val = self.scalar_to_sql(val)?;
893 if let ast::Expr::Value(ValueWithSpan {
894 value: ast::Value::Null,
895 span: _,
896 }) = &val
897 {
898 None
899 } else {
900 Some(Box::new(val))
901 }
902 }))
903 }
904 datafusion_expr::window_frame::WindowFrameBound::CurrentRow => {
905 Ok(ast::WindowFrameBound::CurrentRow)
906 }
907 }
908 }
909
910 pub(crate) fn function_args_to_sql(
911 &self,

Callers 1

expr_to_sql_innerMethod · 0.80

Calls 2

newFunction · 0.85
scalar_to_sqlMethod · 0.80

Tested by

no test coverage detected