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/22 23:55:56 UTC

[GitHub] [incubator-superset] betodealmeida opened a new pull request #12188: fix: CTAS on multiple statements

betodealmeida opened a new pull request #12188:
URL: https://github.com/apache/incubator-superset/pull/12188


   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   
   The current behavior for running CTAS (create table as select) in SQL Lab is to check for **each statement** if it's a `SELECT`, and if so prepend the query with `CREATE TABLE $table_name AS $query`. For example, if we have this query:
   
   ```sql
   SELECT 1 AS col;
   ```
   
   And we run CTAS by passing the table name `my_table` we get this query:
   
   ```sql
   CREATE TABLE my_table AS
   SELECT 1 AS col;
   ```
   
   The problem is that for a query with multiple statements we run CTAS **for each one**:
   
   ```sql
   SELECT 1 AS col;
   SELECT 2 AS col;
   ```
   
   When run with CTAS and `my_table` will produce these 2 queries:
   
   ```sql
   CREATE TABLE my_table AS
   SELECT 1 AS col;
   CREATE TABLE my_table AS
   SELECT 2 AS col;
   ```
   
   The first query runs successfully, but the second fails because the table already exists.
   
   This PR fixes the CTAS behavior, making it more consistent with how multiple statements work in SQL Lab. It changes SQL Lab so that:
   
   1. A CTAS query can have multiple statements, as long as the last one is a `SELECT`. This allows user to pre-process the data before loading it into the table. A simple example in MySQL would be:
   
   ```sql
   SET @value = 42;
   SELECT @value AS foo;
   ```
   
   When run in a CTAS, this will create a table with the column `foo` with a row with the value 42,  as expected.
   
   In Hive, a common pattern is to write queries like this:
   
   ```sql
   INSERT OVERWRITE staging_table ...;
   SELECT * FROM staging_table WHERE ...;
   ```
   
   Which should also work.
   
   2. A CVAS (create view as select) query, on the other hand, can have a single statement and it MUST be a `SELECT`. Before, there was no differentiation between CTAS and CVAS (other than the query generated).
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   N/A
   
   ### TEST PLAN
   <!--- What steps should be taken to verify the changes -->
   
   Tested manually, will add unit tests.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Changes UI
   - [ ] Requires DB Migration.
   - [ ] Confirm DB Migration upgrade and downgrade tested.
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


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


[GitHub] [incubator-superset] codecov-io edited a comment on pull request #12188: fix: CTAS on multiple statements

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12188:
URL: https://github.com/apache/incubator-superset/pull/12188#issuecomment-749844762


   # [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=h1) Report
   > Merging [#12188](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=desc) (f795874) into [master](https://codecov.io/gh/apache/incubator-superset/commit/a52031a55ef6bf0fe6d01bac879ce3fb92e82a48?el=desc) (a52031a) will **decrease** coverage by `3.00%`.
   > The diff coverage is `86.66%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/12188/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12188      +/-   ##
   ==========================================
   - Coverage   66.61%   63.60%   -3.01%     
   ==========================================
     Files         994      484     -510     
     Lines       49079    29769   -19310     
     Branches     4982        0    -4982     
   ==========================================
   - Hits        32695    18936   -13759     
   + Misses      16254    10833    -5421     
   + Partials      130        0     -130     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `?` | |
   | python | `63.60% <86.66%> (-0.62%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/sql\_lab.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `79.43% <75.00%> (-0.19%)` | :arrow_down: |
   | [superset/sql\_parse.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3BhcnNlLnB5) | `99.36% <100.00%> (+0.02%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `54.61% <0.00%> (-29.62%)` | :arrow_down: |
   | [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `79.59% <0.00%> (-12.25%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `70.56% <0.00%> (-12.13%)` | :arrow_down: |
   | [superset/examples/world\_bank.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvd29ybGRfYmFuay5weQ==) | `97.10% <0.00%> (-2.90%)` | :arrow_down: |
   | [superset/examples/birth\_names.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvYmlydGhfbmFtZXMucHk=) | `96.51% <0.00%> (-2.33%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `80.70% <0.00%> (-1.76%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `87.22% <0.00%> (-1.64%)` | :arrow_down: |
   | ... and [515 more](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=footer). Last update [a52031a...f795874](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-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


[GitHub] [incubator-superset] codecov-io edited a comment on pull request #12188: fix: CTAS on multiple statements

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12188:
URL: https://github.com/apache/incubator-superset/pull/12188#issuecomment-749844762


   # [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=h1) Report
   > Merging [#12188](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=desc) (06ebf9c) into [master](https://codecov.io/gh/apache/incubator-superset/commit/a52031a55ef6bf0fe6d01bac879ce3fb92e82a48?el=desc) (a52031a) will **decrease** coverage by `3.10%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/12188/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12188      +/-   ##
   ==========================================
   - Coverage   66.61%   63.51%   -3.11%     
   ==========================================
     Files         994      484     -510     
     Lines       49079    29771   -19308     
     Branches     4982        0    -4982     
   ==========================================
   - Hits        32695    18908   -13787     
   + Misses      16254    10863    -5391     
   + Partials      130        0     -130     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `?` | |
   | python | `63.51% <100.00%> (-0.72%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/sql\_lab.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `80.37% <100.00%> (+0.75%)` | :arrow_up: |
   | [superset/sql\_parse.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3BhcnNlLnB5) | `99.36% <100.00%> (+0.02%)` | :arrow_up: |
   | [superset/sql\_validators/postgres.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvcG9zdGdyZXMucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [superset/views/database/views.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2Uvdmlld3MucHk=) | `62.50% <0.00%> (-25.07%)` | :arrow_down: |
   | [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `79.59% <0.00%> (-12.25%)` | :arrow_down: |
   | [superset/databases/commands/create.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2NyZWF0ZS5weQ==) | `83.67% <0.00%> (-8.17%)` | :arrow_down: |
   | [superset/databases/commands/update.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL3VwZGF0ZS5weQ==) | `85.71% <0.00%> (-8.17%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `74.67% <0.00%> (-8.01%)` | :arrow_down: |
   | [superset/db\_engine\_specs/base.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2Jhc2UucHk=) | `79.38% <0.00%> (-6.71%)` | :arrow_down: |
   | [superset/sql\_validators/base.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvYmFzZS5weQ==) | `93.33% <0.00%> (-6.67%)` | :arrow_down: |
   | ... and [525 more](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=footer). Last update [a52031a...06ebf9c](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-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


[GitHub] [incubator-superset] codecov-io edited a comment on pull request #12188: fix: CTAS on multiple statements

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12188:
URL: https://github.com/apache/incubator-superset/pull/12188#issuecomment-749844762


   # [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=h1) Report
   > Merging [#12188](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=desc) (f3c7036) into [master](https://codecov.io/gh/apache/incubator-superset/commit/a52031a55ef6bf0fe6d01bac879ce3fb92e82a48?el=desc) (a52031a) will **decrease** coverage by `3.89%`.
   > The diff coverage is `86.66%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/12188/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12188      +/-   ##
   ==========================================
   - Coverage   66.61%   62.71%   -3.90%     
   ==========================================
     Files         994      994              
     Lines       49079    49085       +6     
     Branches     4982     4983       +1     
   ==========================================
   - Hits        32695    30786    -1909     
   - Misses      16254    18099    +1845     
   - Partials      130      200      +70     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `61.20% <ø> (-0.04%)` | :arrow_down: |
   | python | `63.70% <86.66%> (-0.53%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/sql\_lab.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `79.43% <75.00%> (-0.19%)` | :arrow_down: |
   | [superset/sql\_parse.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3BhcnNlLnB5) | `99.36% <100.00%> (+0.02%)` | :arrow_up: |
   | [superset-frontend/src/explore/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvQXBwLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/dashboard/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/setup/setupColors.js](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwQ29sb3JzLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/explore/reducers/index.js](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvaW5kZXguanM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...et-frontend/src/dashboard/containers/Dashboard.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb250YWluZXJzL0Rhc2hib2FyZC5qc3g=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...t-frontend/src/dashboard/containers/SliceAdder.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb250YWluZXJzL1NsaWNlQWRkZXIuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...t-frontend/src/explore/reducers/getInitialState.js](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvZ2V0SW5pdGlhbFN0YXRlLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | ... and [187 more](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=footer). Last update [a52031a...f3c7036](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-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


[GitHub] [incubator-superset] mistercrunch commented on pull request #12188: fix: CTAS on multiple statements

Posted by GitBox <gi...@apache.org>.
mistercrunch commented on pull request #12188:
URL: https://github.com/apache/incubator-superset/pull/12188#issuecomment-754115960


   > What would be an example use case for using CTAS ?
   
   If you mean "why materialize a dataset?", the main reason is to create a summary and/or richer dataset to speed subsequent queries against this snapshot
   
   If you mean "why using the Superset CTAS feature over simply writing your own `CREATE TABLE {} AS`" statement, it has to do with administrator/policy control. It's possible in Superset to NOT give DML access, but allow people to effectively do this in a controlled way, and even force a target location/naming scheme for the CTAS-generated table


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


[GitHub] [incubator-superset] codecov-io edited a comment on pull request #12188: fix: CTAS on multiple statements

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12188:
URL: https://github.com/apache/incubator-superset/pull/12188#issuecomment-749844762


   # [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=h1) Report
   > Merging [#12188](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=desc) (f3c7036) into [master](https://codecov.io/gh/apache/incubator-superset/commit/a52031a55ef6bf0fe6d01bac879ce3fb92e82a48?el=desc) (a52031a) will **decrease** coverage by `2.91%`.
   > The diff coverage is `86.66%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/12188/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12188      +/-   ##
   ==========================================
   - Coverage   66.61%   63.70%   -2.92%     
   ==========================================
     Files         994      484     -510     
     Lines       49079    29773   -19306     
     Branches     4982        0    -4982     
   ==========================================
   - Hits        32695    18966   -13729     
   + Misses      16254    10807    -5447     
   + Partials      130        0     -130     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `?` | |
   | python | `63.70% <86.66%> (-0.53%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/sql\_lab.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `79.43% <75.00%> (-0.19%)` | :arrow_down: |
   | [superset/sql\_parse.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3BhcnNlLnB5) | `99.36% <100.00%> (+0.02%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `54.61% <0.00%> (-29.62%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `70.56% <0.00%> (-12.13%)` | :arrow_down: |
   | [superset/examples/world\_bank.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvd29ybGRfYmFuay5weQ==) | `97.10% <0.00%> (-2.90%)` | :arrow_down: |
   | [superset/examples/birth\_names.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvYmlydGhfbmFtZXMucHk=) | `96.51% <0.00%> (-2.33%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `80.70% <0.00%> (-1.76%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `88.04% <0.00%> (-0.82%)` | :arrow_down: |
   | [...ns/versions/73fd22e742ab\_add\_dynamic\_plugins\_py.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbWlncmF0aW9ucy92ZXJzaW9ucy83M2ZkMjJlNzQyYWJfYWRkX2R5bmFtaWNfcGx1Z2luc19weS5weQ==) | `0.00% <0.00%> (ø)` | |
   | ... and [516 more](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=footer). Last update [a52031a...f3c7036](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-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


[GitHub] [incubator-superset] amitmiran137 commented on pull request #12188: fix: CTAS on multiple statements

Posted by GitBox <gi...@apache.org>.
amitmiran137 commented on pull request #12188:
URL: https://github.com/apache/incubator-superset/pull/12188#issuecomment-754112697


   What would be an example use case for using CTAS ?


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


[GitHub] [incubator-superset] codecov-io commented on pull request #12188: fix: CTAS on multiple statements

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #12188:
URL: https://github.com/apache/incubator-superset/pull/12188#issuecomment-749844762


   # [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=h1) Report
   > Merging [#12188](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=desc) (1817053) into [master](https://codecov.io/gh/apache/incubator-superset/commit/a52031a55ef6bf0fe6d01bac879ce3fb92e82a48?el=desc) (a52031a) will **decrease** coverage by `3.11%`.
   > The diff coverage is `86.66%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/12188/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12188      +/-   ##
   ==========================================
   - Coverage   66.61%   63.50%   -3.12%     
   ==========================================
     Files         994      484     -510     
     Lines       49079    29771   -19308     
     Branches     4982        0    -4982     
   ==========================================
   - Hits        32695    18906   -13789     
   + Misses      16254    10865    -5389     
   + Partials      130        0     -130     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `?` | |
   | python | `63.50% <86.66%> (-0.72%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/sql\_lab.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `79.43% <75.00%> (-0.19%)` | :arrow_down: |
   | [superset/sql\_parse.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3BhcnNlLnB5) | `99.36% <100.00%> (+0.02%)` | :arrow_up: |
   | [superset/sql\_validators/postgres.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvcG9zdGdyZXMucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [superset/views/database/views.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2Uvdmlld3MucHk=) | `62.69% <0.00%> (-24.88%)` | :arrow_down: |
   | [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `79.59% <0.00%> (-12.25%)` | :arrow_down: |
   | [superset/databases/commands/create.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2NyZWF0ZS5weQ==) | `83.67% <0.00%> (-8.17%)` | :arrow_down: |
   | [superset/databases/commands/update.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL3VwZGF0ZS5weQ==) | `85.71% <0.00%> (-8.17%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `74.67% <0.00%> (-8.01%)` | :arrow_down: |
   | [superset/db\_engine\_specs/base.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2Jhc2UucHk=) | `79.38% <0.00%> (-6.71%)` | :arrow_down: |
   | [superset/sql\_validators/base.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvYmFzZS5weQ==) | `93.33% <0.00%> (-6.67%)` | :arrow_down: |
   | ... and [522 more](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=footer). Last update [a52031a...f795874](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-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


[GitHub] [incubator-superset] codecov-io edited a comment on pull request #12188: fix: CTAS on multiple statements

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12188:
URL: https://github.com/apache/incubator-superset/pull/12188#issuecomment-749844762


   # [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=h1) Report
   > Merging [#12188](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=desc) (f795874) into [master](https://codecov.io/gh/apache/incubator-superset/commit/a52031a55ef6bf0fe6d01bac879ce3fb92e82a48?el=desc) (a52031a) will **decrease** coverage by `3.90%`.
   > The diff coverage is `86.66%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/12188/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12188      +/-   ##
   ==========================================
   - Coverage   66.61%   62.71%   -3.91%     
   ==========================================
     Files         994      994              
     Lines       49079    49074       -5     
     Branches     4982     4982              
   ==========================================
   - Hits        32695    30775    -1920     
   - Misses      16254    18099    +1845     
   - Partials      130      200      +70     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `61.23% <ø> (ø)` | |
   | python | `63.66% <86.66%> (-0.56%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/sql\_lab.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `79.43% <75.00%> (-0.19%)` | :arrow_down: |
   | [superset/sql\_parse.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3BhcnNlLnB5) | `99.36% <100.00%> (+0.02%)` | :arrow_up: |
   | [superset-frontend/src/explore/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvQXBwLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/dashboard/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/setup/setupColors.js](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwQ29sb3JzLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/explore/reducers/index.js](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvaW5kZXguanM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...et-frontend/src/dashboard/containers/Dashboard.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb250YWluZXJzL0Rhc2hib2FyZC5qc3g=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...t-frontend/src/dashboard/containers/SliceAdder.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb250YWluZXJzL1NsaWNlQWRkZXIuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...t-frontend/src/explore/reducers/getInitialState.js](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvZ2V0SW5pdGlhbFN0YXRlLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | ... and [179 more](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=footer). Last update [a52031a...f795874](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-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


[GitHub] [incubator-superset] codecov-io edited a comment on pull request #12188: fix: CTAS on multiple statements

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12188:
URL: https://github.com/apache/incubator-superset/pull/12188#issuecomment-749844762






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


[GitHub] [incubator-superset] betodealmeida commented on a change in pull request #12188: fix: CTAS on multiple statements

Posted by GitBox <gi...@apache.org>.
betodealmeida commented on a change in pull request #12188:
URL: https://github.com/apache/incubator-superset/pull/12188#discussion_r548925735



##########
File path: superset/sql_lab.py
##########
@@ -337,6 +331,32 @@ def execute_sql_statements(  # pylint: disable=too-many-arguments, too-many-loca
     query.start_running_time = now_as_float()
     session.commit()
 
+    # Should we create a table or view from the select?
+    if (
+        query.select_as_cta
+        and query.ctas_method == CtasMethod.TABLE
+        and not parsed_query.is_valid_ctas()
+    ):
+        raise SqlLabException(
+            _(
+                "CTAS (create table as select) can only be run with a query where "
+                "the last statement is a SELECT. Please make sure your query has "
+                "a SELECT as its last statement. Then, try running your query again."
+            )
+        )
+    if (
+        query.select_as_cta
+        and query.ctas_method == CtasMethod.VIEW
+        and not parsed_query.is_valid_cvas()
+    ):
+        raise SqlLabException(
+            _(
+                "CVAS (create view as select) can only be run with a query with "
+                "a single SELECT statement. Please make sure your query has only "
+                "a SELECT statement. Then, try running your query again."
+            )
+        )

Review comment:
       Ah, great point, @villebro! I'll move the exception message closer to the checks.




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


[GitHub] [incubator-superset] codecov-io edited a comment on pull request #12188: fix: CTAS on multiple statements

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12188:
URL: https://github.com/apache/incubator-superset/pull/12188#issuecomment-749844762






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


[GitHub] [incubator-superset] betodealmeida merged pull request #12188: fix: CTAS on multiple statements

Posted by GitBox <gi...@apache.org>.
betodealmeida merged pull request #12188:
URL: https://github.com/apache/incubator-superset/pull/12188


   


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


[GitHub] [incubator-superset] codecov-io edited a comment on pull request #12188: fix: CTAS on multiple statements

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12188:
URL: https://github.com/apache/incubator-superset/pull/12188#issuecomment-749844762


   # [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=h1) Report
   > Merging [#12188](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=desc) (f3c7036) into [master](https://codecov.io/gh/apache/incubator-superset/commit/a52031a55ef6bf0fe6d01bac879ce3fb92e82a48?el=desc) (a52031a) will **decrease** coverage by `3.27%`.
   > The diff coverage is `86.66%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/12188/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12188      +/-   ##
   ==========================================
   - Coverage   66.61%   63.34%   -3.28%     
   ==========================================
     Files         994      484     -510     
     Lines       49079    29758   -19321     
     Branches     4982        0    -4982     
   ==========================================
   - Hits        32695    18850   -13845     
   + Misses      16254    10908    -5346     
   + Partials      130        0     -130     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `?` | |
   | python | `63.34% <86.66%> (-0.88%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/sql\_lab.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `79.43% <75.00%> (-0.19%)` | :arrow_down: |
   | [superset/sql\_parse.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3BhcnNlLnB5) | `99.36% <100.00%> (+0.02%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/databases/commands/create.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2NyZWF0ZS5weQ==) | `32.65% <0.00%> (-59.19%)` | :arrow_down: |
   | [superset/sql\_validators/postgres.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvcG9zdGdyZXMucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `54.61% <0.00%> (-29.62%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `59.64% <0.00%> (-22.81%)` | :arrow_down: |
   | [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `79.59% <0.00%> (-12.25%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `70.56% <0.00%> (-12.13%)` | :arrow_down: |
   | [superset/databases/commands/update.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL3VwZGF0ZS5weQ==) | `85.71% <0.00%> (-8.17%)` | :arrow_down: |
   | ... and [539 more](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=footer). Last update [a52031a...f3c7036](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-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


[GitHub] [incubator-superset] villebro commented on a change in pull request #12188: fix: CTAS on multiple statements

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #12188:
URL: https://github.com/apache/incubator-superset/pull/12188#discussion_r548447560



##########
File path: superset/sql_lab.py
##########
@@ -337,6 +331,32 @@ def execute_sql_statements(  # pylint: disable=too-many-arguments, too-many-loca
     query.start_running_time = now_as_float()
     session.commit()
 
+    # Should we create a table or view from the select?
+    if (
+        query.select_as_cta
+        and query.ctas_method == CtasMethod.TABLE
+        and not parsed_query.is_valid_ctas()
+    ):
+        raise SqlLabException(
+            _(
+                "CTAS (create table as select) can only be run with a query where "
+                "the last statement is a SELECT. Please make sure your query has "
+                "a SELECT as its last statement. Then, try running your query again."
+            )
+        )
+    if (
+        query.select_as_cta
+        and query.ctas_method == CtasMethod.VIEW
+        and not parsed_query.is_valid_cvas()
+    ):
+        raise SqlLabException(
+            _(
+                "CVAS (create view as select) can only be run with a query with "
+                "a single SELECT statement. Please make sure your query has only "
+                "a SELECT statement. Then, try running your query again."
+            )
+        )

Review comment:
       As the error messages imply a deep understanding of how `is_valid_ctas()` and `is_valid_cvas()` work, I wonder if these should be moved into `ParsedQuery` as something like `assert_is_valid_ctas()` and `assert_is_valid_cvas()` and have the error messages there?




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


[GitHub] [incubator-superset] codecov-io edited a comment on pull request #12188: fix: CTAS on multiple statements

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12188:
URL: https://github.com/apache/incubator-superset/pull/12188#issuecomment-749844762






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


[GitHub] [incubator-superset] codecov-io edited a comment on pull request #12188: fix: CTAS on multiple statements

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12188:
URL: https://github.com/apache/incubator-superset/pull/12188#issuecomment-749844762


   # [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=h1) Report
   > Merging [#12188](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=desc) (f3c7036) into [master](https://codecov.io/gh/apache/incubator-superset/commit/a52031a55ef6bf0fe6d01bac879ce3fb92e82a48?el=desc) (a52031a) will **decrease** coverage by `3.55%`.
   > The diff coverage is `86.66%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/12188/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12188      +/-   ##
   ==========================================
   - Coverage   66.61%   63.06%   -3.56%     
   ==========================================
     Files         994      994              
     Lines       49079    49085       +6     
     Branches     4982     4983       +1     
   ==========================================
   - Hits        32695    30955    -1740     
   - Misses      16254    17930    +1676     
   - Partials      130      200      +70     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `61.20% <ø> (-0.04%)` | :arrow_down: |
   | python | `64.26% <86.66%> (+0.04%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/sql\_lab.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `79.43% <75.00%> (-0.19%)` | :arrow_down: |
   | [superset/sql\_parse.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3BhcnNlLnB5) | `99.36% <100.00%> (+0.02%)` | :arrow_up: |
   | [superset-frontend/src/explore/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvQXBwLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/dashboard/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/setup/setupColors.js](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwQ29sb3JzLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/explore/reducers/index.js](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvaW5kZXguanM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...et-frontend/src/dashboard/containers/Dashboard.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb250YWluZXJzL0Rhc2hib2FyZC5qc3g=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...t-frontend/src/dashboard/containers/SliceAdder.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb250YWluZXJzL1NsaWNlQWRkZXIuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...t-frontend/src/explore/reducers/getInitialState.js](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvZ2V0SW5pdGlhbFN0YXRlLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | ... and [181 more](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=footer). Last update [a52031a...f3c7036](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-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


[GitHub] [incubator-superset] codecov-io edited a comment on pull request #12188: fix: CTAS on multiple statements

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12188:
URL: https://github.com/apache/incubator-superset/pull/12188#issuecomment-749844762






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


[GitHub] [incubator-superset] codecov-io edited a comment on pull request #12188: fix: CTAS on multiple statements

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12188:
URL: https://github.com/apache/incubator-superset/pull/12188#issuecomment-749844762


   # [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=h1) Report
   > Merging [#12188](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=desc) (f3c7036) into [master](https://codecov.io/gh/apache/incubator-superset/commit/a52031a55ef6bf0fe6d01bac879ce3fb92e82a48?el=desc) (a52031a) will **decrease** coverage by `2.96%`.
   > The diff coverage is `86.66%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/12188/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12188      +/-   ##
   ==========================================
   - Coverage   66.61%   63.64%   -2.97%     
   ==========================================
     Files         994      484     -510     
     Lines       49079    29773   -19306     
     Branches     4982        0    -4982     
   ==========================================
   - Hits        32695    18950   -13745     
   + Misses      16254    10823    -5431     
   + Partials      130        0     -130     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `?` | |
   | python | `63.64% <86.66%> (-0.58%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/sql\_lab.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `79.43% <75.00%> (-0.19%)` | :arrow_down: |
   | [superset/sql\_parse.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3BhcnNlLnB5) | `99.36% <100.00%> (+0.02%)` | :arrow_up: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `54.61% <0.00%> (-29.62%)` | :arrow_down: |
   | [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `79.59% <0.00%> (-12.25%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `70.56% <0.00%> (-12.13%)` | :arrow_down: |
   | [superset/examples/world\_bank.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvd29ybGRfYmFuay5weQ==) | `97.10% <0.00%> (-2.90%)` | :arrow_down: |
   | [superset/examples/birth\_names.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZXhhbXBsZXMvYmlydGhfbmFtZXMucHk=) | `96.51% <0.00%> (-2.33%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `80.70% <0.00%> (-1.76%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `87.22% <0.00%> (-1.64%)` | :arrow_down: |
   | ... and [518 more](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=footer). Last update [a52031a...f3c7036](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-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


[GitHub] [incubator-superset] codecov-io edited a comment on pull request #12188: fix: CTAS on multiple statements

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12188:
URL: https://github.com/apache/incubator-superset/pull/12188#issuecomment-749844762


   # [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=h1) Report
   > Merging [#12188](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=desc) (f795874) into [master](https://codecov.io/gh/apache/incubator-superset/commit/a52031a55ef6bf0fe6d01bac879ce3fb92e82a48?el=desc) (a52031a) will **decrease** coverage by `3.65%`.
   > The diff coverage is `86.66%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/12188/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12188      +/-   ##
   ==========================================
   - Coverage   66.61%   62.96%   -3.66%     
   ==========================================
     Files         994      994              
     Lines       49079    49074       -5     
     Branches     4982     4982              
   ==========================================
   - Hits        32695    30899    -1796     
   - Misses      16254    17975    +1721     
   - Partials      130      200      +70     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `61.23% <ø> (ø)` | |
   | python | `64.08% <86.66%> (-0.15%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/sql\_lab.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `79.43% <75.00%> (-0.19%)` | :arrow_down: |
   | [superset/sql\_parse.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3BhcnNlLnB5) | `99.36% <100.00%> (+0.02%)` | :arrow_up: |
   | [superset-frontend/src/explore/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvQXBwLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/dashboard/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/setup/setupColors.js](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwQ29sb3JzLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/explore/reducers/index.js](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvaW5kZXguanM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...et-frontend/src/dashboard/containers/Dashboard.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb250YWluZXJzL0Rhc2hib2FyZC5qc3g=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...t-frontend/src/dashboard/containers/SliceAdder.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb250YWluZXJzL1NsaWNlQWRkZXIuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...t-frontend/src/explore/reducers/getInitialState.js](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvZ2V0SW5pdGlhbFN0YXRlLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | ... and [176 more](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=footer). Last update [a52031a...f795874](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-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


[GitHub] [incubator-superset] codecov-io edited a comment on pull request #12188: fix: CTAS on multiple statements

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #12188:
URL: https://github.com/apache/incubator-superset/pull/12188#issuecomment-749844762


   # [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=h1) Report
   > Merging [#12188](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=desc) (f795874) into [master](https://codecov.io/gh/apache/incubator-superset/commit/a52031a55ef6bf0fe6d01bac879ce3fb92e82a48?el=desc) (a52031a) will **decrease** coverage by `3.55%`.
   > The diff coverage is `86.66%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/12188/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #12188      +/-   ##
   ==========================================
   - Coverage   66.61%   63.05%   -3.56%     
   ==========================================
     Files         994      994              
     Lines       49079    49074       -5     
     Branches     4982     4982              
   ==========================================
   - Hits        32695    30946    -1749     
   - Misses      16254    17928    +1674     
   - Partials      130      200      +70     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `61.23% <ø> (ø)` | |
   | python | `64.24% <86.66%> (+0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/sql\_lab.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `79.43% <75.00%> (-0.19%)` | :arrow_down: |
   | [superset/sql\_parse.py](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3BhcnNlLnB5) | `99.36% <100.00%> (+0.02%)` | :arrow_up: |
   | [superset-frontend/src/explore/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvQXBwLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/dashboard/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9BcHAuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/setup/setupColors.js](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwQ29sb3JzLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [superset-frontend/src/explore/reducers/index.js](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvaW5kZXguanM=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...et-frontend/src/dashboard/containers/Dashboard.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb250YWluZXJzL0Rhc2hib2FyZC5qc3g=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...t-frontend/src/dashboard/containers/SliceAdder.jsx](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb250YWluZXJzL1NsaWNlQWRkZXIuanN4) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...t-frontend/src/explore/reducers/getInitialState.js](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvZ2V0SW5pdGlhbFN0YXRlLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | ... and [171 more](https://codecov.io/gh/apache/incubator-superset/pull/12188/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=footer). Last update [a52031a...f795874](https://codecov.io/gh/apache/incubator-superset/pull/12188?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-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


[GitHub] [incubator-superset] bkyryliuk commented on pull request #12188: fix: CTAS on multiple statements

Posted by GitBox <gi...@apache.org>.
bkyryliuk commented on pull request #12188:
URL: https://github.com/apache/incubator-superset/pull/12188#issuecomment-754139289


   +1 to this comment, we are actively leveraging it
   > > What would be an example use case for using CTAS ?
   > 
   > If you mean "why materialize a dataset?", the main reason is to create a summary and/or richer dataset to speed subsequent queries against this snapshot
   > 
   > If you mean "why using the Superset CTAS feature over simply writing your own `CREATE TABLE {} AS`" statement, it has to do with administrator/policy control. It's possible in Superset to NOT give DML access, but allow people to effectively do this in a controlled way, and even force a target location/naming scheme for the CTAS-generated table
   
   


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