You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by andrewor14 <gi...@git.apache.org> on 2016/06/03 01:18:15 UTC

[GitHub] spark pull request #13490: [SPARK-15722][SQL] Disallow specifying schema in ...

GitHub user andrewor14 opened a pull request:

    https://github.com/apache/spark/pull/13490

    [SPARK-15722][SQL] Disallow specifying schema in CTAS statement

    ## What changes were proposed in this pull request?
    
    As of this patch, this leads to an exception because the schemas may not match:
    ```
    CREATE TABLE students (age INT, name STRING) AS SELECT * FROM boxes
    ```
    but this is OK:
    ```
    CREATE TABLE students AS SELECT * FROM boxes
    ```
    this is also OK because there's not an existing schema for us to borrow from:
    ```
    CREATE TABLE students (age INT, name STRING) AS SELECT 1, 'hello'
    ```
    
    ## How was this patch tested?
    
    SQLQuerySuite, HiveDDLCommandSuite

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/andrewor14/spark ctas-no-column

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/13490.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #13490
    
----
commit 1e3704550dde279215a49db41cfa3bdbd44809d4
Author: Andrew Or <an...@databricks.com>
Date:   2016-06-02T01:04:14Z

    Ban CTAS with schema

commit 347d8b361ecc21c446e6b5186e2af2e519c5d549
Author: Andrew Or <an...@databricks.com>
Date:   2016-06-02T01:08:45Z

    Fix tests

commit fc372f5d487109bf5cf7cc59f41f38004f2bc108
Author: Andrew Or <an...@databricks.com>
Date:   2016-06-03T01:13:18Z

    Fix tests
    
    Now we throw an exception only if the SELECT statement actually
    reads from a table, which has a schema.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #13490: [SPARK-15722][SQL] Disallow specifying schema in ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/13490


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13490: [SPARK-15722][SQL] Disallow specifying schema in CTAS st...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13490
  
    **[Test build #59910 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59910/consoleFull)** for PR 13490 at commit [`fc372f5`](https://github.com/apache/spark/commit/fc372f5d487109bf5cf7cc59f41f38004f2bc108).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13490: [SPARK-15722][SQL] Disallow specifying schema in CTAS st...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13490
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13490: [SPARK-15722][SQL] Disallow specifying schema in CTAS st...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/13490
  
    m2.0


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13490: [SPARK-15722][SQL] Disallow specifying schema in CTAS st...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the issue:

    https://github.com/apache/spark/pull/13490
  
    @cloud-fan @clockfly 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13490: [SPARK-15722][SQL] Disallow specifying schema in CTAS st...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13490
  
    **[Test build #59910 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59910/consoleFull)** for PR 13490 at commit [`fc372f5`](https://github.com/apache/spark/commit/fc372f5d487109bf5cf7cc59f41f38004f2bc108).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13490: [SPARK-15722][SQL] Disallow specifying schema in CTAS st...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/13490
  
    LGTM


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13490: [SPARK-15722][SQL] Disallow specifying schema in CTAS st...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13490
  
    **[Test build #59954 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59954/consoleFull)** for PR 13490 at commit [`1e3fd2e`](https://github.com/apache/spark/commit/1e3fd2e369dff47df4af5b439ec1bc9ebff5fca8).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13490: [SPARK-15722][SQL] Disallow specifying schema in CTAS st...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/13490
  
    I  think this should also throw exception
    ```
    CREATE TABLE students (age INT, name STRING) AS SELECT 1, 'hello'
    ```
    
    A `SELECT` also defines both the name and data type of its output(the `projectList` in `Project` are all `NamedExpression`), we should not define the schema again.
    
    BTW, what's the behaviour of other DB?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13490: [SPARK-15722][SQL] Disallow specifying schema in CTAS st...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13490
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13490: [SPARK-15722][SQL] Disallow specifying schema in CTAS st...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13490
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/59954/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13490: [SPARK-15722][SQL] Disallow specifying schema in CTAS st...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/13490
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/59910/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13490: [SPARK-15722][SQL] Disallow specifying schema in CTAS st...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/13490
  
    **[Test build #59954 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59954/consoleFull)** for PR 13490 at commit [`1e3fd2e`](https://github.com/apache/spark/commit/1e3fd2e369dff47df4af5b439ec1bc9ebff5fca8).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #13490: [SPARK-15722][SQL] Disallow specifying schema in CTAS st...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the issue:

    https://github.com/apache/spark/pull/13490
  
    Sounds good. I've updated the patch.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org