-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Attach Diagnostic
to "incompatible type in unary expression" error
#14433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Diagnostic
to "incompatible type in unary expression" error
I think this is a good first issue as the need is clear and the tests in https://github.com/apache/datafusion/blob/85fbde2661bdb462fc498dc18f055c44f229604c/datafusion/sql/tests/cases/diagnostic.rs are well structured for extension. |
take |
Hi @eliaperantoni, would you mind sharing your rendering code snippet? It helps verifying if my implementation is correct! Also, I'm a bit lost on how to implement this. |
Hey @alan910127, sorry for the delay, thank you so much for taking on this ticket! I suggest you look at We try to make our own "viewer" implementation not influence the design of The type of As for the In any case, I think it's perfectly fine if in this PR you don't get it 100% right. e.g. I think it's okay if nested unary expressions only highlight the column name (e.g. |
@eliaperantoni thank you so much for the detailed explanation! Since |
For a perfect implementation, yes that would be necessary. But that goes well beyond the scope of this ticket. I think it's perfectly fine if, in the case of And then a more extensive implementation of |
Hey @alan910127 how is it going with this ticket :) Can I help with anything? |
@eliaperantoni I am trying to locate where does |
I've found that the relevant code is in I see two possible approaches to resolving this:
Do you have any thoughts on this? |
@eliaperantoni for the others unary expression.
IMHHHHHHHO, we only have to handle the Datafusion ParserError "Cannot parse {signed_number} as f64" for Minus unary expression and add test case for that. |
I get this in Which is not very helpful. It seems like datafusion requires exactly a boolean expression with the Could you make sure that Datafusion quits with an error decorated with a nice You don't necessarily have to build and attach the
If possible, I think the
Yeah I think you can ignore those :)
I'm not sure how that error is produced. What query are you using? I get this: I think that's the one we should probably add a Thank you so much for your contribution :) ❤ |
Is your feature request related to a problem or challenge?
For a query like:
The only message that the end user of an application built atop of DataFusion sees is:
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:
See #14429 for more information.
Describe the solution you'd like
Attach a well crafted
Diagnostic
to theDataFusionError
, 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
The text was updated successfully, but these errors were encountered: