alamb commented on issue #13753:
URL: https://github.com/apache/datafusion/issues/13753#issuecomment-2541977343
> AFAIK Rust doesn't allow downcasting from a `dyn` object to a trait (i.e.
`Unparseable`) - it needs to be the concrete type.
I think it my example `unparseable` would be `&dyn Unparseable` 👍
```rust
let user_defined_local_node: dyn &UserDefinedLogicalNode = ...;
// is the user defined node unparseable?
let Some(unparseable) = user_defined_local_node. // <---- this is `&dyn
Unparseable` I think
.as_any()
.downcast_ref::<Unparseable>() else {
return plan_err!("Node type {} does not implement Unparseable",
user_defined_local_node.name())
}
let sql_nodes = unparseable.unparse(unparser, ....)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]