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

Using 'USING provider' to specify a different table provider in CREATE TABLE LIKE

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.0.0
    • SQL
    • None

    Description

      Use CREATE TABLE tb1 LIKE tb2 command to create an empty table tb1 based on the definition of table tb2. The most user case is to create tb1 with the same schema of tb2. But an inconvenient case here is this command also copies the FileFormat from tb2, it cannot change the input/output format and serde. Add the ability of changing file format is useful for some scenarios like upgrading a table from a low performance file format to a high performance one (parquet, orc).

      Hive support STORED AS new file format syntax:

      CREATE TABLE tbl(a int) STORED AS TEXTFILE;
      CREATE TABLE tbl2 LIKE tbl STORED AS PARQUET;
      

      We add a similar syntax for Spark. Here we separate to two features:
      1. specify a different table provider in CREATE TABLE LIKE
      2. Hive compatibility

      In this PR, we address the first one:
      Using `USING provider` to specify a different table provider in CREATE TABLE LIKE.

      Attachments

        Issue Links

          Activity

            People

              cltlfcjin Lantao Jin
              cltlfcjin Lantao Jin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: