alamb commented on code in PR #9563:
URL: https://github.com/apache/arrow-datafusion/pull/9563#discussion_r1522299523
##########
datafusion/optimizer/src/analyzer/rewrite_expr.rs:
##########
@@ -137,6 +136,19 @@ impl TreeNodeRewriter for OperatorToFunctionRewriter {
}) = expr
{
match field {
+ GetFieldAccess::NamedStructField { name, .. } => {
+ let expr = *expr.clone();
+ let name = name.clone();
+ let args = vec![expr, Expr::Literal(name)];
+ return Ok(Transformed::yes(Expr::ScalarFunction(
+ ScalarFunction::new_udf(
+ Arc::new(ScalarUDF::new_from_impl(
+
datafusion_functions::core::getfield::GetFieldFunc::new(),
+ )),
+ args,
+ ),
+ )));
+ }
Review Comment:
I think we could implement this rewrite more easily using the API proposed
in https://github.com/apache/arrow-datafusion/pull/9583 (so you could use
datafusion_functions directly)
--
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]