HeartSaVioR opened a new pull request #27107: [SPARK-30436][SQL] Allow CREATE 
EXTERNAL TABLE with only requiring LOCATION
URL: https://github.com/apache/spark/pull/27107
 
 
   ### What changes were proposed in this pull request?
   
   This patch fixes CREATE EXTERNAL TABLE statement to follow the rule of 
create table for Hive table instead of normal table.
   
   There're two major statements on supporting create table (createTable / 
createHiveTable in SqlBase.g4). As we support external table only for Hive 
table, the code seems to only allow `external` in createHiveTable which is only 
determined when there's any unique option for Hive in create table clauses, 
which is breaking change and don't seem to be intuitive.
   
   As we only support external table for Hive table, we could simplify the 
parser rule via always referring Hive table for "CREATE EXTERNAL TABLE". We no 
longer need to verify createTable to check whether `external` is available.
   
   ### Why are the changes needed?
   
   `CREATE EXTERNAL TABLE ... LOCATION` is broken, and it doesn't make sense to 
let end users specify the unique option only available for Hive table to make 
it work.
   
   ### Does this PR introduce any user-facing change?
   
   Maybe yes, given the changes:
   
   * CREATE EXTERNAL TABLE will always be considered as Hive table.
     * It doesn't allow to provide "USING", unlike CREATE TABLE.
     * CREATE EXTERNAL TABLE uses same createTableClauses as Hive table, 
instead of normal table.
   
   ### How was this patch tested?
   
   Modified UTs. Jenkins build will follow.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to