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,
)
| 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], |
no test coverage detected