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

Alter partition command with database name as prefix returns error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • HiveServer2
    • None

    Description

      Hello Team

      Observed an issue when running alter table command on partition data to change the datatype , the command returns an error[2] when the command prefixed with database name as shown below.

       

      [1]

      Alter table databasename.tablename partition (ld_yr='2018',ld_mn='12',ld_dy='27') change columnA columnA varchar(64);

      [2]

      Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Unable to alter partition. Alter partition operation fails: NoSuchObjectException(message:partition values=[2018, 07, 23])

       
      The solution to resolve the error[2] is as follows.

      a) if you are running queries via hive/beeline then please run command "use database" and the run the query without database name.
      example :

      use database;
      Alter table tablename partition (ld_yr='2018',ld_mn='12',ld_dy='27') change columnA columnA varchar(64);

      b) if you are running queries via hue then please select the database first from drop down and then run the query without database name.

      Alter table tablename partition (ld_yr='2018',ld_mn='12',ld_dy='27') change columnA columnA varchar(64);
       

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            msinghcloudera Manpreet Singh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: