satwikmishra11 commented on issue #22131:
URL: https://github.com/apache/datafusion/issues/22131#issuecomment-4440079178
Thanks for the question — happy to clarify!
The key difference is **rendered output**, not the error message text itself.
When a GROUP BY column is missing, DataFusion's diagnostics framework
renders the error with a precise source span pointing to the offending column
in the original query text — something like:
```
Error during planning: Column "b" must appear in GROUP BY
--> SQL:1:11
|
1 | SELECT a, b FROM t GROUP BY a
| ^ column not in GROUP BY
```
But for a function argument type error, even though the error *message* is
descriptive (`coercion from Utf8 to Uniform(1, [Float64, Float32]) failed`),
you get **no source location, no `-->` pointer, no caret** under the offending
argument:
```
SELECT sqrt('hello');
-- No span, no pointer to 'hello', no column/line reference
```
The proposal is to make the *rendering* consistent — so the output would
look like:
```
Error during planning: function 'sqrt' does not support argument of type
Utf8 at position 1
--> SQL:1:13
|
1 | SELECT sqrt('hello')
| ^^^^^^^ expected a numeric type
```
The existing `Diagnostic` / `DiagnosticEntry` framework already supports
this rendering — it just hasn't been wired up for the type-coercion path yet.
That's the gap I'm proposing to close.
Does that clarify the intent? Happy to refine the scope further based on
your feedback before writing any code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]