apache / apache/datafusion

Add sqllogictest coverage for UDWF return types in information_schema

Open
#20,090 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

### Context

In #20079, the `information_schema` was updated to use `return_field_from_args` / `return_field` / `WindowUDFFieldArgs::field` instead of the older `return_type` API for UDFs, UDAFs, and UDWFs.

As noted in [this review comment](https://github.com/apache/datafusion/pull/20079#discussion_r2749229459), it would be good to add sqllogictest coverage to verify that `information_schema.routines` correctly reports return types for window UDFs (the `get_udwf_args_and_return_types` path).

### What needs to be done

Add a sqllogictest (in `test_files/information_schema.slt` or a new file) that:

1. Registers a window UDF (or uses a built-in one)
2. Queries `information_schema.routines` filtering for that window function
3. Asserts the return type column is populated correctly (previously it was always `NULL`)

The relevant code is in [`datafusion/catalog/src/information_schema.rs`](https://github.com/apache/datafusion/blob/main/datafusion/catalog/src/information_schema.rs) around the `get_udwf_args_and_return_types` function.

### Willingness to submit a PR

Yes, but as this can potentially be a good newcomer task i'm up to leave for someone else

Contributor guide

Open the contributing guide

Research direction

Start with test_files/information_schema.slt and inspect existing information_schema sqllogictests, then read datafusion/catalog/src/information_schema.rs around get_udwf_args_and_return_types. Add coverage that registers or uses a window UDF, queries information_schema.routines for it, and asserts the return type is populated correctly rather than NULL.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, sql
Domain
databases, testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.