You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/01/16 16:43:35 UTC

[GitHub] amalakar opened a new issue #6707: Realtime syntax validation of queries in SQL lab

amalakar opened a new issue #6707: Realtime syntax validation of queries in SQL lab
URL: https://github.com/apache/incubator-superset/issues/6707
 
 
   Real time query validation in sql labI think could be a very useful and powerful feature, it can bring in equivalent productivity modern IDEs bring to programming. I also noticed that query engine's like presto does have a very easy way to validate queries, prepending `explain (TYPE VALIDATE)` to a query validates the syntax of the query. Other query engine's may support similar functionalities as well. Here is some test of query validation for presto engine
   
   ## Valid query
   
   ```
   presto:default> explain (TYPE VALIDATE) select * from hive.default.test_table where ds='2019-01-01' limit 10;
    Valid
   -------
    true
   (1 row)
   ```
   
   ## Invalid table name:
   
   ```presto:default> explain (TYPE VALIDATE) select * from hive.default.test_table_x where ds='2019-01-01'  limit 10;
   Query 20190116_163346_02068_b85df failed: line 1:39: Table hive.default.test_table_x does not exist
   explain (TYPE VALIDATE) select * from hive.default.test_table_x where ds='2019-01-01' and audit_source='presto' limit 10 
   ```
   
   ## Invalid column
   ```
   presto:default> explain (TYPE VALIDATE) select * from hive.default.test_table_x where ds='2019-01-01' and col1='abc' limit 10;
   Query 20190116_163535_02086_b85df failed: line 1:99: Column 'col1' cannot be resolved
   explain (TYPE VALIDATE) select * from hive.default.test_table_x where ds='2019-01-01' and col1='abc' limit 10
   ```
   
   More: https://prestodb.io/docs/current/sql/explain.html

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org