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

Method array_element_to_sql

datafusion/sql/src/unparser/expr.rs:684–696  ·  view source on GitHub ↗
(&self, args: &[Expr])

Source from the content-addressed store, hash-verified

682 }
683
684 fn array_element_to_sql(&self, args: &[Expr]) -> Result<ast::Expr> {
685 assert_eq_or_internal_err!(
686 args.len(),
687 2,
688 "array_element must have exactly 2 arguments"
689 );
690 let array = self.expr_to_sql(&args[0])?;
691 let index = self.expr_to_sql(&args[1])?;
692 Ok(ast::Expr::CompoundFieldAccess {
693 root: Box::new(array),
694 access_chain: vec![ast::AccessExpr::Subscript(Subscript::Index { index })],
695 })
696 }
697
698 fn named_struct_to_sql(&self, args: &[Expr]) -> Result<ast::Expr> {
699 assert_or_internal_err!(

Callers 1

Calls 2

newFunction · 0.85
expr_to_sqlMethod · 0.80

Tested by

no test coverage detected