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 2020/12/03 08:38:22 UTC

[GitHub] [incubator-superset] villebro commented on a change in pull request #11904: feat: run BQ queries as single statement

villebro commented on a change in pull request #11904:
URL: https://github.com/apache/incubator-superset/pull/11904#discussion_r534924100



##########
File path: superset/sql_lab.py
##########
@@ -322,9 +322,15 @@ def execute_sql_statements(  # pylint: disable=too-many-arguments, too-many-loca
         raise SqlLabException("Results backend isn't configured.")
 
     # Breaking down into multiple statements
-    parsed_query = ParsedQuery(rendered_query)
-    statements = parsed_query.get_statements()
-    logger.info("Query %s: Executing %i statement(s)", str(query_id), len(statements))
+    if not db_engine_spec.run_multiple_statements_as_one:
+        parsed_query = ParsedQuery(rendered_query)
+        statements = parsed_query.get_statements()
+        logger.info(
+            "Query %s: Executing %i statement(s)", str(query_id), len(statements)
+        )
+    else:
+        statements = [rendered_query]
+        logger.info("Query %s: Executing query as a single statement(s)", str(query_id))

Review comment:
       nit:
   ```suggestion
       if not db_engine_spec.run_multiple_statements_as_one:
           parsed_query = ParsedQuery(rendered_query)
           statements = parsed_query.get_statements()
           logger.info(
               "Query %s: Executing %i statement(s)", str(query_id), len(statements)
           )
       else:
           statements = [rendered_query]
           logger.info("Query %s: Executing query as a single statement", str(query_id))
   ```




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