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

Method extension_to_statement

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

Try to unparse a [UserDefinedLogicalNode] to a SQL statement. If multiple unparsers are registered for the same [UserDefinedLogicalNode], the first unparsing result will be returned.

(
        &self,
        node: &dyn UserDefinedLogicalNode,
    )

Source from the content-addressed store, hash-verified

142 /// If multiple unparsers are registered for the same [UserDefinedLogicalNode],
143 /// the first unparsing result will be returned.
144 fn extension_to_statement(
145 &self,
146 node: &dyn UserDefinedLogicalNode,
147 ) -> Result<ast::Statement> {
148 let mut statement = None;
149 for unparser in &self.extension_unparsers {
150 match unparser.unparse_to_statement(node, self)? {
151 UnparseToStatementResult::Modified(stmt) => {
152 statement = Some(stmt);
153 break;
154 }
155 UnparseToStatementResult::Unmodified => {}
156 }
157 }
158 if let Some(statement) = statement {
159 Ok(statement)
160 } else {
161 not_impl_err!("Unsupported extension node: {node:?}")
162 }
163 }
164
165 /// Try to unparse a [UserDefinedLogicalNode] to a SQL statement.
166 /// If multiple unparsers are registered for the same [UserDefinedLogicalNode],

Callers 1

plan_to_sqlMethod · 0.80

Calls 1

unparse_to_statementMethod · 0.45

Tested by

no test coverage detected