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

AlterTableAlterPartitionOperation cannot change the type if the column has default partition

    XMLWordPrintableJSON

Details

    Description

      Steps to repro the case :

      create database pt;
      create table pt.alterdynamic_part_table(intcol string) partitioned by (partcol1 string, partcol2 string);
      insert into table pt.alterdynamic_part_table partition(partcol1, partcol2) select NULL, '2', NULL;
      alter table pt.alterdynamic_part_table partition column (partcol2 int);

      Exception is thrown:

      org.apache.hadoop.hive.ql.metadata.HiveException: Exception while checking type conversion of existing partition values to FieldSchema(name:partcol2, type:int, comment:null) : Exception while converting string to int for value : NULL
          at org.apache.hadoop.hive.ql.ddl.table.partition.alter.AlterTableAlterPartitionOperation.check(AlterTableAlterPartitionOperation.java:69)
          at org.apache.hadoop.hive.ql.ddl.table.partition.alter.AlterTableAlterPartitionOperation.execute(AlterTableAlterPartitionOperation.java:55)

      Attachments

        Issue Links

          Activity

            People

              dengzh Zhihua Deng
              dengzh Zhihua Deng
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: