Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-24724

Create table with LIKE operator does not work correctly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 4.0.0
    • Fix Version/s: None
    • Component/s: Hive, HiveServer2
    • Labels:
      None

      Description

      Steps to repro:

      create table atable (id int, str1 string);
      alter table atable add constraint pk_atable primary key (id) disable novalidate;
      
      create table btable like atable;
      
      

      describe formatted btable lacks the constraints information.

      CreateTableLikeDesc does not set/fetch the constraints for LIKE table

      https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java#L13594-L13616

      neither DDLTask fetches/set the constraints for the table.

      https://github.com/apache/hive/blob/5ba3dfcb6470ff42c58a3f95f0d5e72050274a42/ql/src/java/org/apache/hadoop/hive/ql/ddl/table/create/like/CreateTableLikeOperation.java#L58-L83

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Rajkumar Singh Rajkumar Singh
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: