test: add sqllogictest coverage for UDWF return types in information_… #20098
+43
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Add sqllogictest coverage to verify that
information_schema.routinescorrectly reports return types for window user-defined functions (UDWFs).Why are the changes needed?
PR #20079 updated the information schema to use newer APIs for reporting function return types. Previously, window functions always showed
NULLfor their return type ininformation_schema.routines. The implementation was fixed butlacked test coverage to prevent regression.
This PR adds tests specifically for the
get_udwf_args_and_return_typescode path indatafusion/catalog/src/information_schema.rs.Which issue does this PR close?
Closes #20090
What tests are included?
This PR adds 6 test cases to
datafusion/sqllogictest/test_files/information_schema.slt:Test window functions with concrete return types:
row_number→Int64rank→Int64dense_rank→Int64Test window functions with generic return types:
lag→Null(type depends on input)lead→Null(type depends on input)Combined test:
is_deterministicflagBefore this PR (current behavior):
All window functions show
NULLfordata_type:+--------------+-----------+---------------+
| routine_name | data_type | function_type |
+--------------+-----------+---------------+
| row_number | NULL | WINDOW |
| rank | NULL | WINDOW |
| dense_rank | NULL | WINDOW |
+--------------+-----------+---------------+
After PR #20079 merges (expected behavior):
Window functions will show proper return types:
+--------------+-----------+---------------+
| routine_name | data_type | function_type |
+--------------+-----------+---------------+
| row_number | Int64 | WINDOW |
| rank | Int64 | WINDOW |
| dense_rank | Int64 | WINDOW |
+--------------+-----------+---------------+
Dependencies
The tests in this PR will fail until #20079 is merged because the underlying implementation doesn't yet report window function return types correctly. Once #20079 merges, these tests will pass and ensure the fix works correctly.
Are there any user-facing changes?
No, this only adds test coverage. The functionality change is in PR #20079.
📝 Initial Comment (Add After Creating PR)
Status
This PR is marked as Draft because it depends on #20079 being merged first.
Current test status:
Verification:
I've manually verified the current behavior: