gruuya commented on code in PR #7981:
URL: https://github.com/apache/arrow-datafusion/pull/7981#discussion_r1376005289


##########
datafusion/sqllogictest/test_files/distinct_on.slt:
##########


Review Comment:
   All tests here were compared for accuracy against Postgres.
   
   Note that, while the 
[docs](https://www.postgresql.org/docs/current/sql-select.html#SQL-DISTINCT) 
state that in the absence of the `ORDER BY` clause the output is unpredictable, 
in practice I've noticed it is stable on Postgres for the table below, whereas 
that isn't the case for DataFusion, hence why I omitted those tests for now. 



##########
datafusion/optimizer/src/push_down_projection.rs:
##########
@@ -228,7 +228,7 @@ impl OptimizerRule for PushDownProjection {
                 // Gather all columns needed for expressions in this Aggregate
                 let mut new_aggr_expr = vec![];
                 for e in agg.aggr_expr.iter() {
-                    let column = Column::from_name(e.display_name()?);
+                    let column = Column::from(e.display_name()?);

Review Comment:
   This allows one to correctly re-construct a column whose qualifier has been 
crammed into the name by aliasing with `.display_name()`, which is what I'm 
doing in `replace_distinct_aggregate` in this PR. Not sure whether this makes 
sense in general though.



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