AdamGS commented on code in PR #22604:
URL: https://github.com/apache/datafusion/pull/22604#discussion_r3320384359


##########
datafusion/physical-expr/src/projection.rs:
##########
@@ -661,7 +661,7 @@ impl ProjectionExprs {
         for proj_expr in self.exprs.iter() {
             let expr = &proj_expr.expr;
             let col_stats = if let Some(col) = expr.downcast_ref::<Column>() {
-                std::mem::take(&mut stats.column_statistics[col.index()])
+                column_statistics_at(&stats.column_statistics, col.index())

Review Comment:
   Because I'm using `Column`, we currently assume it has stats. I think 
falling back here to `unknown` is reasonable.
   I think a follow up here might be to craft more accurate stats depending on 
what created the virtual column.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to