apache / apache/datafusion

Attach `Diagnostic` to "wrong number of arguments" error

オープン
#14,432 コメント 15 件 リアクション 0 件 担当者 1 名 @Chen-Yuan-Lai が担当を希望しています GitHub で見る
enhancement good first issue
主要言語
Rust
スター
9.3k
フォーク
2.4k
平均マージ
3日 11時間
マージ済み PR(30日)
362

説明

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

For a query like:

```sql
SELECT sum(1, 2)
```

The only message that the end user of an application built atop of DataFusion sees is:

```
Error during planning: Execution error: User-defined coercion failed with Execution("SUM expects exactly one argument") No function matches the given name and argument types 'sum(Int64, Int64)'. You might need to add explicit type casts.
Candidate functions:
sum(UserDefined)
```

We want to provide a richer message that _references and highlights locations in the original SQL query_, and contextualises and helps the user understand the error. In the end, it would be possible to display errors in a fashion akin to what was enabled by #13664 for some errors:

![](https://github.com/user-attachments/assets/32efeb4f-aad9-41c9-a1e3-600a00d525c3)

See #14429 for more information.

### Describe the solution you'd like

Attach a well crafted `Diagnostic` to the `DataFusionError`, building on top of the foundations laid in #13664. See #14429 for more information.

### Describe alternatives you've considered

_No response_

### Additional context

_No response_

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。