Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-2637

Can't ALTER TABLE to new database if all columns are complex types

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • Impala 2.3.0
    • None
    • Frontend

    Description

      I have a table, NO_SCALAR_TYPES, that I accidentally created in the wrong database. Trying to use ALTER TABLE ... RENAME fails with a Hive metastore error.

      Another table, COMPLEX_TYPES_TOP_LEVEL, has exactly the same layout but one additional column that's a scalar (BIGINT). ALTER TABLE ... RENAME works OK for that table.

      Since I noticed we do have some error-handling behavior for SELECT * if all the columns are complex types, I figured we should also do something user-friendly for ALTER TABLE ... RENAME on the same table.

      [localhost:21000] > desc no_scalar_types;
      Query: describe no_scalar_types
      +------+-----------------+---------+
      | name | type            | comment |
      +------+-----------------+---------+
      | a    | array<int>      |         |
      | s    | struct<         |         |
      |      |   field1:int,   |         |
      |      |   field2:string |         |
      |      | >               |         |
      | m1   | map<int,string> |         |
      | m2   | map<string,int> |         |
      +------+-----------------+---------+
      [localhost:21000] > alter table no_scalar_types rename to jdr.no_scalar_types;
      Query: alter table no_scalar_types rename to jdr.no_scalar_types
      ERROR: 
      ImpalaRuntimeException: Error making 'alter_table' RPC to Hive Metastore: 
      CAUSED BY: TProtocolException: Required field 'statsObj' is unset! Struct:ColumnStatistics(statsDesc:ColumnStatisticsDesc(isTblLevel:true, dbName:jdr, tableName:no_scalar_types), statsObj:null)
      
      [localhost:21000] > alter table complex_types_top_level rename to jdr.complex_types_top_level;
      Query: alter table complex_types_top_level rename to jdr.complex_types_top_level
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            jrussell John Russell
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: