Error highlighting in query strings #12345
Replies: 2 comments
|
Probably more appropriate for the sqlparser crate, see repo: https://github.com/apache/datafusion-sqlparser-rs/ |
|
This is now partly supported in current DataFusion. Enable For multiple planning errors, DataFusion now has The tests in The important boundary is syntax recovery. The SQL parser reports token locations for a parse failure, but it does not currently recover through an invalid statement to return every independent syntax error in one pass. Also, not every planner error has been annotated with a diagnostic span yet, so
That provides multi-error highlighting for the planning/schema phase today, but full multi-error syntax diagnostics would still require recovery support in |
Uh oh!
There was an error while loading. Please reload this page.
Hi all, I'm currently using DataFusion to generate logical plans from a user-inputted SQL query. I was wondering if it's possible to analyze a SQL query string to identify errors and their corresponding locations (line number/column). Using
SessionContext::sql_with_options, I am able to get a single error, but it doesn't include location within the query string.Ideally, I'd like to be able to get all errors and locations, for the purposes of highlighting in a text editor -- both syntactic and plan/schema errors.
All reactions