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

How to specify/create primary key in HIVE 2.6 Version

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.1.0
    • None
    • Beeline
    • None

    Description

      Hello,

      I Am using Apache Hive 2.1.0 version. I am trying to create a simple table with 2 columns and trying to set the first column as primary key. But it is throwing error.

       0: jdbc:hive2://10.230.245.94:10000/s3_data> ALTER TABLE VENDOR ADD CONSTRAINT VENDOR_PK PRIMARY KEY (VENDOR_ID);
      Error: Error while compiling statement: FAILED: ParseException line 1:19 cannot recognize input near 'ADD' 'CONSTRAINT' 'VENDOR_PK' in alter table statement (state=42000,code=40000)

      I read that primary key concept has been added from 2.1 version , but then when I try to create in beeline it's not recognizing the keyword "PRIMARY KEY".

      Please help!

      Attachments

        Activity

          People

            Unassigned Unassigned
            Anusha2607 Anusha Pillala
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: