[ 
https://issues.apache.org/jira/browse/SPARK-32603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17190480#comment-17190480
 ] 

angerszhu commented on SPARK-32603:
-----------------------------------

In current grammar
{code:java}
| replaceTableHeader ('(' colTypeList ')')? tableProvider
    createTableClauses
    (AS? query)?                                                   #replaceTable
| createTableHeader ('(' colTypeList ')')? tableProvider
    createTableClauses
    (AS? query)?                                                   #createTable
| createTableHeader ('(' columns=colTypeList ')')?
    (commentSpec |
    (PARTITIONED BY '(' partitionColumns=colTypeList ')' |
    PARTITIONED BY partitionColumnNames=identifierList) |
    bucketSpec |
    skewSpec |
    rowFormat |
    createFileFormat |
    locationSpec |
    (TBLPROPERTIES tableProps=tablePropertyList))*
    (AS? query)?                                                   
#createHiveTable
{code}
without tableProvider (USING xxx), will be defined as hive 's way.  
Implementing `support the syntax without USING _.` doesn't make much sense.

 

 

> CREATE/REPLACE TABLE AS SELECT not support multi-part identifiers
> -----------------------------------------------------------------
>
>                 Key: SPARK-32603
>                 URL: https://issues.apache.org/jira/browse/SPARK-32603
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 3.1.0
>            Reporter: Huaxin Gao
>            Priority: Major
>
> {code:java}
> == SQL ==
> CREATE TABLE h2.test.abc AS SELECT * FROM h2.test.people
> ^^^
> org.apache.spark.sql.catalyst.parser.ParseException: 
> Operation not allowed: CREATE TABLE ... STORED AS ... does not support 
> multi-part identifiers
> {code}
> {code:java}
> == SQL ==
> CREATE OR REPLACE TABLE h2.test.abc AS SELECT 1 as col
> ------------------------------------^^^
> org.apache.spark.sql.catalyst.parser.ParseException: 
> mismatched input 'AS' expecting {'(', 'USING'}
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to