You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/03/07 21:12:15 UTC

[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #5485: AggregateStatistics min/max/count take_optimizable replace col_expr name with casted_expr name

alamb commented on code in PR #5485:
URL: https://github.com/apache/arrow-datafusion/pull/5485#discussion_r1128594945


##########
datafusion/core/src/physical_optimizer/aggregate_statistics.rs:
##########
@@ -189,10 +189,9 @@ fn take_optimizable_column_count(
                     ..
                 } = &col_stats[col_expr.index()]
                 {
-                    let expr = format!("COUNT({})", col_expr.name());
                     return Some((
                         ScalarValue::Int64(Some((num_rows - val) as i64)),
-                        expr,
+                        casted_expr.name().to_string(),

Review Comment:
   I wonder if we could use https://docs.rs/datafusion/19.0.0/datafusion/prelude/enum.Expr.html#method.display_name instead of `name` here (which might also resolve any discrepancies) 🤔 



-- 
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-unsubscribe@arrow.apache.org

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