xudong963 opened a new pull request, #27848:
URL: https://github.com/apache/datafusion/pull/27848

   ## Which issue does this PR close?
   
   - Backport of #27547 to `branch-56`, for #24463, which lists it as a 
regression in 56.
   - Part of #25464.
   
   ## Rationale for this change
   
   #25409, new in 56, stopped `date_trunc` from propagating its input ordering 
for every timezone-aware timestamp. So since 56.0.0, sorting or grouping by 
`date_trunc('minute', ts)` over input ordered on `ts` adds a sort and loses 
clustered aggregation, where 55 did not. #27547 restores the ordering for 
`minute` and finer granularities, where truncation is arithmetic on the epoch 
value and cannot reorder values.
   
   ## What changes are included in this PR?
   
   A clean cherry-pick of #27547 (`477c7b9`) with `-x`. No conflicts.
   
   ## What is the testing strategy for this PR?
   
   The `date_trunc` unit tests and `datetime/timestamps.slt` pass on this 
branch.
   
   Applied on `branch-56` together with the backports of #27021, #27150, #27732 
and #26261 (opened alongside this one), the full sqllogictest suite, `cargo fmt 
--check` and clippy on the touched crates also pass.
   
   ## Are there any user-facing changes?
   
   Plans only: no `SortExec`, and clustered aggregation, for `date_trunc` at 
`minute` and finer over ordered timezone-aware input. Results are unchanged. No 
API changes.
   


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