-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
feat: Live query validation in the SQL Lab UI #7461
feat: Live query validation in the SQL Lab UI #7461
Conversation
This builds on apache#7422 to build check-as-you-type sql query validation in Sql Lab. This closes apache#6707 too. It adds a (debounced) call to the validate_sql_json API endpoint with the querytext, and on Lyft infra is able to return feedback to the user (end to end) in $TBD seconds. At present feedback is provided only through the "annotations" mechanism build in to ACE, although I'd be open to adding full text elsewhere on the page if there's interest.
Adding @kristw and @williaster for :eyes |
@@ -126,6 +133,11 @@ class SqlEditor extends React.PureComponent { | |||
} | |||
onSqlChanged(sql) { | |||
this.setState({ sql }); | |||
// Request server-side validation of the query text | |||
if (this.canValidateQuery()) { | |||
// NB. requestValidation is debounced |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is NB?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I never realized that was weird, but I guess it is a bit now that I think about it!
NB means "nota bene", latin for "note well" — I usually use it in comments where "NOTE:" would also work
* [WIP] Live query validation, where supported This builds on apache#7422 to build check-as-you-type sql query validation in Sql Lab. This closes apache#6707 too. It adds a (debounced) call to the validate_sql_json API endpoint with the querytext, and on Lyft infra is able to return feedback to the user (end to end) in $TBD seconds. At present feedback is provided only through the "annotations" mechanism build in to ACE, although I'd be open to adding full text elsewhere on the page if there's interest. * fix: Unbreak lints and tests
* [WIP] Live query validation, where supported This builds on #7422 to build check-as-you-type sql query validation in Sql Lab. This closes #6707 too. It adds a (debounced) call to the validate_sql_json API endpoint with the querytext, and on Lyft infra is able to return feedback to the user (end to end) in $TBD seconds. At present feedback is provided only through the "annotations" mechanism build in to ACE, although I'd be open to adding full text elsewhere on the page if there's interest. * fix: Unbreak lints and tests
) * [WIP] Live query validation, where supported This builds on apache#7422 to build check-as-you-type sql query validation in Sql Lab. This closes apache#6707 too. It adds a (debounced) call to the validate_sql_json API endpoint with the querytext, and on Lyft infra is able to return feedback to the user (end to end) in $TBD seconds. At present feedback is provided only through the "annotations" mechanism build in to ACE, although I'd be open to adding full text elsewhere on the page if there's interest. * fix: Unbreak lints and tests
* [WIP] Live query validation, where supported This builds on #7422 to build check-as-you-type sql query validation in Sql Lab. This closes #6707 too. It adds a (debounced) call to the validate_sql_json API endpoint with the querytext, and on Lyft infra is able to return feedback to the user (end to end) in $TBD seconds. At present feedback is provided only through the "annotations" mechanism build in to ACE, although I'd be open to adding full text elsewhere on the page if there's interest. * fix: Unbreak lints and tests
CATEGORY
Choose one
SUMMARY
This builds on #7422 to build check-as-you-type sql query validation in Sql Lab. This closes #6707 too.
This adds a (debounced) call to the
validate_sql_json
API endpoint with the querytext. If no validator is configured for the selected database, per the feature flag from #7422, no validation requests will be sent from the UI. On Lyft's infra the presto validator is able to return feedback to the user (end to end) in about 2 seconds.At present feedback is provided only through the "annotations" mechanism build in to ACE, although I'd be open to adding full text elsewhere on the page if there's interest.
This diff does not include new cypress tests covering this interaction.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Server error reporting:
Query error reporting:
TEST PLAN
You can verify the unhappy paths by:
ADDITIONAL INFORMATION
REVIEWERS
@xtinec @DiggidyDave @khtruong @betodealmeida