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

Method build_flatten_value_select_item

datafusion/sql/src/unparser/plan.rs:1597–1613  ·  view source on GitHub ↗

Build a `SELECT alias."VALUE"` item for Snowflake FLATTEN output.

(
        &self,
        flatten_alias: &str,
        user_alias: Option<&str>,
    )

Source from the content-addressed store, hash-verified

1595
1596 /// Build a `SELECT alias."VALUE"` item for Snowflake FLATTEN output.
1597 fn build_flatten_value_select_item(
1598 &self,
1599 flatten_alias: &str,
1600 user_alias: Option<&str>,
1601 ) -> ast::SelectItem {
1602 let compound = ast::Expr::CompoundIdentifier(vec![
1603 self.new_ident_quoted_if_needs(flatten_alias.to_string()),
1604 Ident::with_quote('"', "VALUE"),
1605 ]);
1606 match user_alias {
1607 Some(alias) => ast::SelectItem::ExprWithAlias {
1608 expr: compound,
1609 alias: self.new_ident_quoted_if_needs(alias.to_string()),
1610 },
1611 None => ast::SelectItem::UnnamedExpr(compound),
1612 }
1613 }
1614
1615 /// Convert an `Unnest` logical plan node to a `LATERAL FLATTEN(INPUT => expr, ...)`
1616 /// table factor for Snowflake-style SQL output.

Callers 1

Calls 2

to_stringMethod · 0.45

Tested by

no test coverage detected