findepi commented on code in PR #12177:
URL: https://github.com/apache/datafusion/pull/12177#discussion_r1734155882
##########
datafusion/optimizer/src/single_distinct_to_groupby.rs:
##########
@@ -624,14 +624,14 @@ mod tests {
vec![col("a")],
false,
None,
- Some(vec![col("a")]),
+ Some(vec![col("a").sort(true, false)]),
None,
));
let plan = LogicalPlanBuilder::from(table_scan)
.aggregate(vec![col("c")], vec![expr, count_distinct(col("b"))])?
.build()?;
// Do nothing
- let expected = "Aggregate: groupBy=[[test.c]], aggr=[[sum(test.a)
ORDER BY [test.a], count(DISTINCT test.b)]] [c:UInt32, sum(test.a) ORDER BY
[test.a]:UInt64;N, count(DISTINCT test.b):Int64]\
+ let expected = "Aggregate: groupBy=[[test.c]], aggr=[[sum(test.a)
ORDER BY [test.a ASC NULLS LAST], count(DISTINCT test.b)]] [c:UInt32,
sum(test.a) ORDER BY [test.a ASC NULLS LAST]:UInt64;N, count(DISTINCT
test.b):Int64]\
Review Comment:
the default ASC/DESC NULLS FIRST/LAST behavior seems to come from
https://github.com/apache/datafusion/blob/c22e13fa1062578a82bd33c1bce40c01dbeae760/datafusion/sql/src/expr/order_by.rs#L101-L107
if i read this correctly, ASC NULLS LAST is the default
--
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]