Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-19115

SparkSQL unsupports the command " create external table if not exist new_tbl like old_tbl location '/warehouse/new_tbl' "

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.1
    • 2.2.0
    • SQL
    • None
    • spark2.0.1 hive1.2.1

    • Important

    Description

      spark2.0.1 unsupports the command " create external table if not exist new_tbl like old_tbl location '/warehouse/new_tbl' "
      we tried to modify the sqlbase.g4 file,change
      " | CREATE TABLE (IF NOT EXISTS)? target=tableIdentifier
      LIKE source=tableIdentifier #createTableLike"
      to
      " | CREATE EXTERNAL? TABLE (IF NOT EXISTS)? target=tableIdentifier
      LIKE source=tableIdentifier locationSpec? #createTableLike"
      modify method 'visitCreateTableLike' in scala file 'SparkSqlParser.scala' and update case class CreateTableLikeCommand in 'tables.scala' file
      finally we compiled spark and replaced the jars as follow: 'spark-catalyst-2.0.1.jar','spark-sql_2.11-2.0.1.jar', and run the command 'create external table if not exist new_tbl like old_tbl location '/warehouse/new_tbl' successfully .

      Attachments

        Activity

          People

            ouyangxc.zte Xiaochen Ouyang
            ouyangxc.zte Xiaochen Ouyang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: