jackwener commented on code in PR #4916:
URL: https://github.com/apache/arrow-datafusion/pull/4916#discussion_r1073730679


##########
datafusion/expr/src/utils.rs:
##########
@@ -83,20 +85,16 @@ pub fn grouping_set_to_exprlist(group_expr: &[Expr]) -> 
Result<Vec<Expr>> {
     }
 }
 
-/// Recursively walk an expression tree, collecting the unique set of column 
names
+/// Recursively walk an expression tree, collecting the unique set of columns
 /// referenced in the expression
-struct ColumnNameVisitor<'a> {
-    accum: &'a mut HashSet<Column>,
-}
-
-impl ExpressionVisitor for ColumnNameVisitor<'_> {
-    fn pre_visit(self, expr: &Expr) -> Result<Recursion<Self>> {
+pub fn expr_to_columns(expr: &Expr, accum: &mut HashSet<Column>) -> Result<()> 
{
+    inspect_expr_pre(expr, |expr| {

Review Comment:
   love this change❤️



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to