waynexia commented on code in PR #8119:
URL: https://github.com/apache/arrow-datafusion/pull/8119#discussion_r1390368300


##########
datafusion/substrait/src/logical_plan/producer.rs:
##########
@@ -610,6 +610,35 @@ pub fn to_substrait_agg_measure(
                 }
             })
         }
+        Expr::AggregateUDF(expr::AggregateUDF{ fun, args, filter, order_by }) 
=>{
+            let sorts = if let Some(order_by) = order_by {
+                order_by.iter().map(|expr| to_substrait_sort_field(expr, 
schema, extension_info)).collect::<Result<Vec<_>>>()?
+            } else {
+                vec![]
+            };
+            let mut arguments: Vec<FunctionArgument> = vec![];
+            for arg in args {
+                arguments.push(FunctionArgument { arg_type: 
Some(ArgType::Value(to_substrait_rex(arg, schema, 0, extension_info)?)) });
+            }
+            let function_name = fun.name.to_lowercase();

Review Comment:
   I don't have a specific reason, and I guess this is a convention from 
translating SQL ident, where strings are preprocessed with `normalize_ident()` 
before mapping to concrete functions. But at this stage the input is all 
logical plans. `to_lowercase()` seems unnecessary. How do you think about it?



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