apache / apache/datafusion

Improve `candidate functions` suggestions

Open
#15,817 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

### Is your feature request related to a problem or challenge?

In the test below the suggestion should not be shown

```
> select array_repeat(1, null);
Error during planning: Execution error: Function 'array_repeat' user-defined coercion failed with "Execution error: count must be an integer type" No function matches the given name and argument types 'array_repeat(Int64, Null)'. You might need to add explicit type casts.
Candidate functions:
array_repeat(UserDefined)
```

The error and comment are self explanatory, and having
```
Candidate functions:
array_repeat(UserDefined)
```

is confusing

### Describe the solution you'd like

Its probably not easy to do, but we need to introduce some error type that defines the function was found but the signature is not correct, in this case we should list a function with a correct signature as a suggestion

### Describe alternatives you've considered

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the `array_repeat(1, null)` query and tracing the function-resolution and candidate-suggestion path in DataFusion. Inspect how user-defined coercion failures are represented and how incompatible signatures are selected for display. Done means the error no longer suggests `array_repeat(UserDefined)` when the function exists but its signature does not match, while useful valid candidates remain visible.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.