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

   ## Which issue does this PR close?
   
   * Closes #16297.
   
   ## Rationale for this change
   
   This change implements support for the `GROUPS` window frame unit in 
Substrait round-trip conversions. Several SQLLogicTest cases were failing due 
to DataFusion not supporting `GROUPS` when interpreting Substrait window frame 
bounds. Adding this support improves compatibility and eliminates these 
failures, contributing to broader enhancement efforts described in issue #16248.
   
   ### Before
   ```
   ❯ cargo test --test sqllogictests -- --substrait-round-trip window.slt:1030
       Finished `test` profile [unoptimized + debuginfo] target(s) in 0.52s
        Running bin/sqllogictests.rs 
(target/debug/deps/sqllogictests-abc7c402056c6d3d)
   Completed 2 test files in 1 second                                           
     External error: 1 errors in file 
/Users/kosiew/GitHub/datafusion/datafusion/sqllogictest/test_files/window.slt
   
   1. query failed: DataFusion error: This feature is not implemented: 
Unsupported window frame unit: Groups
   ```
   
   ### After
   ```
   ❯ cargo test --test sqllogictests -- --substrait-round-trip window.slt:1030
       Finished `test` profile [unoptimized + debuginfo] target(s) in 0.79s
        Running bin/sqllogictests.rs 
(target/debug/deps/sqllogictests-abc7c402056c6d3d)
   Completed 2 test files in 1 second
   ```
   
   ## What changes are included in this PR?
   
   * Introduces a new `BoundsTypeExt` enum to bridge Substrait and DataFusion 
window frame units, including the previously unsupported `GROUPS` variant.
   * Updates Substrait consumer logic to interpret `bounds_type` using 
`BoundsTypeExt` and apply appropriate defaulting logic.
   * Updates producer logic to emit the correct Substrait representation for 
`GROUPS`.
   * Refactors existing code paths to centralize conversion logic, improving 
maintainability and consistency.
   
   ## Are these changes tested?
   
   Yes. These changes are validated by existing SQLLogicTest coverage, 
including the failing Substrait round-trip tests such as `window.slt:1030`. 
These tests now pass, confirming correct behavior.
   
   ## Are there any user-facing changes?
   
   No user-facing API changes. Substrait-related behavior is improved 
internally, enabling correct handling of `GROUPS` window frame units without 
altering public interfaces.
   
   ## LLM-generated code disclosure
   
   This pull request includes code, comments that were generated with 
assistance from an LLM. All LLM-generated content has been manually reviewed 
and tested.
   


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