Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16638#discussion_r97446466
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala ---
    @@ -1140,14 +1140,18 @@ class SparkSqlAstBuilder(conf: SQLConf) extends 
AstBuilder {
        *
        * For example:
        * {{{
    -   *   CREATE TABLE [IF NOT EXISTS] [db_name.]table_name
    -   *   LIKE [other_db_name.]existing_table_name
    +   *   CREATE [EXTERNAL] TABLE [IF NOT EXISTS] [db_name.]table_name
    +   *   LIKE [other_db_name.]existing_table_name [locationSpec]
        * }}}
        */
       override def visitCreateTableLike(ctx: CreateTableLikeContext): 
LogicalPlan = withOrigin(ctx) {
         val targetTable = visitTableIdentifier(ctx.target)
         val sourceTable = visitTableIdentifier(ctx.source)
    -    CreateTableLikeCommand(targetTable, sourceTable, ctx.EXISTS != null)
    +    val location = Option(ctx.locationSpec).map(visitLocationSpec)
    +    if (ctx.EXTERNAL != null && location.isEmpty) {
    --- End diff --
    
    Add a comment here:
    ```
        // If we are creating an EXTERNAL table, then the LOCATION field is 
required
    ```


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to