superset-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-superset] nytai edited a comment on pull request #9692: [sqllab] fix, strip comments before parsing statements
Date Fri, 01 May 2020 17:37:37 GMT

nytai edited a comment on pull request #9692:
URL: https://github.com/apache/incubator-superset/pull/9692#issuecomment-622471036


   The issue is that `sqlparse` is returning 2 statements when the statements look like 
   ```sql
   select * from table;
   -- comment
   ```
   I suspect is splits along the `;`.
   [The logic that determines if the statement is DML](https://github.com/preset-io/incubator-superset/blob/master/superset/sql_parse.py#L117)
is just checking that all statements are "SELECT" or "EXPLAIN". The second statement is a
comment, hence it's not SELECT|EXPLAIN, therefore it fails the 'is DML' test. What this PR
does is it strips comments before feeding the statements to `sqlparse` so we're only parsing
actual SQL statements and not comments. 


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


Mime
View raw message