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

   ## Which issue does this PR close?
   
   - Closes #24967.
   
   ## Rationale for this change
   
   The Substrait consumer treats intermediate aggregate phases as complete 
calls. This can silently return final values when a plan requests intermediate 
state, or report an unrelated root-schema naming error.
   
   ## What changes are included in this PR?
   
   - Validate phases in aggregate and window expressions before translating 
their arguments.
   - Accept `INITIAL_TO_RESULT` and retain `UNSPECIFIED` for compatibility with 
existing DataFusion-produced plans.
   - Reject intermediate phases and unknown protobuf enum values with explicit 
errors.
   
   ## What is the testing strategy for this PR?
   
   - Reproduced the original behavior: an `INITIAL_TO_INTERMEDIATE` average 
over values 1 and 2 returned 1.5 instead of intermediate state.
   - Added tests for supported phases, every unsupported phase, rooted and 
unrooted aggregates, unknown binary-protobuf enum values, and actual window 
output.
   - The full Substrait integration target passes: 213 tests passed, with six 
existing tests ignored.
   - The required extended workspace suite passes: 11,267 tests passed, eight 
existing tests ignored, and all 511 SQL logic-test files completed.
   - `cargo clippy --all-targets --all-features -- -D warnings` passes.
   - The complete `./dev/rust_lint.sh` passes, including strict workspace 
documentation checks.
   
   ## Are there any user-facing changes?
   
   Plans with unsupported aggregate or window phases now fail explicitly 
instead of being interpreted as complete calls. Existing unspecified-phase 
plans remain accepted. No public Rust API changes are included. 
Intermediate-state execution and the separate AVG output-type mismatch are not 
addressed here.


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