ShashidharM0118 commented on code in PR #19419:
URL: https://github.com/apache/datafusion/pull/19419#discussion_r2653221843
##########
datafusion/physical-expr/src/projection.rs:
##########
@@ -587,6 +587,54 @@ impl ProjectionExprs {
let expr = &proj_expr.expr;
let col_stats = if let Some(col) =
expr.as_any().downcast_ref::<Column>() {
std::mem::take(&mut stats.column_statistics[col.index()])
+ } else if let Some(literal) =
expr.as_any().downcast_ref::<Literal>() {
+ // Handle literal expressions (constants) by calculating
proper statistics
+ let data_type = expr.data_type(output_schema)?;
+
+ if literal.value().is_null() {
+ let null_count = match stats.num_rows {
+ Precision::Exact(num_rows) =>
Precision::Exact(num_rows),
+ _ => Precision::Absent,
+ };
+
+ ColumnStatistics {
Review Comment:
Agreed, I've Updated
--
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]