manuzhang opened a new pull request, #4749:
URL: https://github.com/apache/datafusion-comet/pull/4749

   ## Which issue does this PR close?
   
   Closes apache/datafusion-comet#4731.
   
   ## Rationale for this change
   
   Spark 4 represents decimal window `AVG` results with a 
`Cast(Divide(WindowExpression, ...))` wrapper. The Comet window converter only 
extracted bare `WindowExpression` values and `MakeDecimal(WindowExpression, 
...)`, so the Spark 4 decimal AVG shape fell back instead of using native Comet 
execution.
   
   ## What changes are included in this PR?
   
   This PR teaches `CometWindowExec` to extract nested window expressions 
through the Spark 4 decimal AVG cast/divide wrapper while preserving the 
wrapper's final decimal result type. It also adds a regression test for decimal 
`AVG` over a partitioned, ordered window.
   
   ## How are these changes tested?
   
   - `git diff --check`
   - `make core`
   - `./mvnw test -Pjdk17 -Dtest=none 
-Dsuites="org.apache.comet.exec.CometWindowExecSuite window: decimal AVG with 
PARTITION BY and ORDER BY" -Dscalastyle.skip=true -DfailIfNoTests=false`
   - `./mvnw test -Pspark-4.0 -Pjdk17 -Dtest=none 
-Dsuites="org.apache.comet.exec.CometWindowExecSuite window: decimal AVG with 
PARTITION BY and ORDER BY" -Dscalastyle.skip=true -DfailIfNoTests=false`
   - `./mvnw test -Pspark-3.5 -Dtest=none 
-Dsuites="org.apache.comet.exec.CometWindowExecSuite window: decimal AVG with 
PARTITION BY and ORDER BY" -Dscalastyle.skip=true -DfailIfNoTests=false`
   - 
`JAVA_HOME=/opt/homebrew/Cellar/openjdk@17/17.0.9/libexec/openjdk.jdk/Contents/Home
 ./mvnw test -Pspark-3.4 -Dtest=none 
-Dsuites="org.apache.comet.exec.CometWindowExecSuite window: decimal AVG with 
PARTITION BY and ORDER BY" -Dscalastyle.skip=true -DfailIfNoTests=false`
   
   ---
   
   Co-authored-by: @codex


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