yyy1000 commented on code in PR #9563:
URL: https://github.com/apache/arrow-datafusion/pull/9563#discussion_r1521752381


##########
datafusion/functions/src/core/struct.rs:
##########
@@ -73,12 +73,6 @@ impl StructFunc {
     }
 }
 
-impl Default for StructFunc {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
 impl ScalarUDFImpl for StructFunc {

Review Comment:
   Last PR I make StructFunc pub so I add the Default trait, but since 
https://github.com/apache/arrow-datafusion/pull/9546#discussion_r1519548725 it 
will not be needed.



##########
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 know the method from 
https://github.com/apache/arrow-datafusion/pull/9546#discussion_r1519548725, 
but it seems that here it can't get the `context_provider`?



-- 
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]

Reply via email to