jayzhan211 commented on code in PR #9563:
URL: https://github.com/apache/arrow-datafusion/pull/9563#discussion_r1522276234
##########
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:
only sql crate can get it directly, or any other crate that has context
##########
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:
only sql crate can get it directly, or any other crate that has `context`
--
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]