Skip to content
43 changes: 43 additions & 0 deletions datafusion/sqllogictest/test_files/information_schema.slt
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,49 @@ select is_deterministic from information_schema.routines where routine_name = 'n
----
false

# Test window function return types in information_schema.routines
# Before PR #20079, window functions would show NULL for data_type
# This test verifies that UDWF return types are correctly reported
Comment on lines +816 to +817
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Before PR #20079, window functions would show NULL for data_type
# This test verifies that UDWF return types are correctly reported

Unnecessary information


query TTT
select routine_name, data_type, function_type from information_schema.routines where routine_name = 'row_number';
----
row_number NULL WINDOW

query TTT
select routine_name, data_type, function_type from information_schema.routines where routine_name = 'rank';
----
rank NULL WINDOW

query TTT
select routine_name, data_type, function_type from information_schema.routines where routine_name = 'dense_rank';
----
dense_rank NULL WINDOW

query TTT
select routine_name, data_type, function_type from information_schema.routines where routine_name = 'lag';
----
lag NULL WINDOW

query TTT
select routine_name, data_type, function_type from information_schema.routines where routine_name = 'lead';
----
lead NULL WINDOW

# Test that window functions return types match their actual behavior
# row_number, rank, dense_rank all return NULL (no return type in signature)
# lag and lead return types depend on their input (shown as NULL in generic signature)
query TTTB
select routine_name, data_type, function_type, is_deterministic
from information_schema.routines
where function_type = 'WINDOW'
and (routine_name = 'row_number' OR routine_name = 'rank' OR routine_name = 'dense_rank')
order by routine_name;
----
dense_rank NULL WINDOW true
rank NULL WINDOW true
row_number NULL WINDOW true
Comment on lines +844 to +856
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what this test is testing thats different from the above queries?


# test every function type are included in the result
query TTTITTTTBI
select * from information_schema.parameters where specific_name = 'date_trunc' OR specific_name = 'string_agg' OR specific_name = 'rank' ORDER BY specific_name, rid, data_type;
Expand Down