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

   ## What changes are included in this PR?
   
   TPC-DS Q32 and Q92 read the same sales and dates to compute both a 
correlated decimal average and the rows compared against it. When the listing 
providers, shared predicates and correlation keys match, evaluate the average 
in a partitioned window. A synthetic row number distinguishes duplicate 
qualifying dimension rows, preserving their multiplicity without multiplying 
the inputs to the average. The analyzer's casts and scalar multiplication 
remain in the comparison.
   
   On each SF1 query the physical plan goes from five Parquet scans and four 
hash joins to three scans and two hash joins. The regression test covers 
duplicate dimension rows, null measures and an extra inner filter that must 
prevent the rewrite. The windows can add buffering when many dimension rows 
qualify.
   
   ## What is the testing strategy for this PR?
   
   TPC-DS SF1, unchanged upstream SQL, local Parquet with ten target 
partitions. Each arm ran in a fresh process, alternating first position across 
nine pairs. Each process ran one warmup and four timed executions. All result 
rows matched across arms. Median of process medians in milliseconds.
   
   | Query | Baseline | Draft | Faster pairs |
   |---|---:|---:|---:|
   | Q32 | 10 | 6 | 9/9 |
   | Q92 | 12.5 | 8 | 9/9 |
   
   ## Are there any user-facing changes?
   
   Eligible queries can show the rewritten plan in EXPLAIN.
   


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