Converts an UNNEST operation to an AST expression by wrapping it as a function call, since there is no direct representation for UNNEST in the AST.
(&self, unnest: &Unnest)
| 1770 | /// Converts an UNNEST operation to an AST expression by wrapping it as a function call, |
| 1771 | /// since there is no direct representation for UNNEST in the AST. |
| 1772 | fn unnest_to_sql(&self, unnest: &Unnest) -> Result<ast::Expr> { |
| 1773 | let args = self.function_args_to_sql(std::slice::from_ref(&unnest.expr))?; |
| 1774 | |
| 1775 | Ok(ast::Expr::Function(Function { |
| 1776 | name: ObjectName::from(vec![Ident { |
| 1777 | value: "UNNEST".to_string(), |
| 1778 | quote_style: None, |
| 1779 | span: Span::empty(), |
| 1780 | }]), |
| 1781 | args: ast::FunctionArguments::List(ast::FunctionArgumentList { |
| 1782 | duplicate_treatment: None, |
| 1783 | args, |
| 1784 | clauses: vec![], |
| 1785 | }), |
| 1786 | filter: None, |
| 1787 | null_treatment: None, |
| 1788 | over: None, |
| 1789 | within_group: vec![], |
| 1790 | parameters: ast::FunctionArguments::None, |
| 1791 | uses_odbc_syntax: false, |
| 1792 | })) |
| 1793 | } |
| 1794 | |
| 1795 | fn arrow_dtype_to_ast_dtype(&self, field: &FieldRef) -> Result<ast::DataType> { |
| 1796 | let data_type = field.data_type(); |
no test coverage detected