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

Query fails with char partition column

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.14.0
    • None

    Description

      For a char partition column, JavaHiveCharObjectInspector attempts to cast HiveCharWritable to HiveChar:

      create table partition_char_1 (key string, value char(20)) partitioned by (dt char(10), region int);
      
      insert overwrite table partition_char_1 partition(dt='2000-01-01', region=1)
        select * from src tablesample (10 rows);
      
      select * from partition_char_1 limit 1;
      
      java.sql.SQLException: Error while compiling statement: FAILED: RuntimeException org.apache.hadoop.hive.ql.metadata.HiveException: Failed with exception org.apache.hadoop.hive.serde2.io.HiveCharWritable cannot be cast to org.apache.hadoop.hive.common.type.HiveCharjava.lang.ClassCastException: org.apache.hadoop.hive.serde2.io.HiveCharWritable cannot be cast to org.apache.hadoop.hive.common.type.HiveChar
      	at org.apache.hadoop.hive.serde2.objectinspector.primitive.JavaHiveCharObjectInspector.set(JavaHiveCharObjectInspector.java:67)
      	at org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorConverter$HiveCharConverter.convert(PrimitiveObjectInspectorConverter.java:506)
      	at org.apache.hadoop.hive.ql.exec.FetchOperator.createPartValue(FetchOperator.java:315)
      

      Attachments

        1. HIVE-7889.patch
          4 kB
          Mohit Sabharwal
        2. HIVE-7889.2.patch
          4 kB
          Mohit Sabharwal
        3. HIVE-7889.1.patch
          4 kB
          Mohit Sabharwal

        Issue Links

          Activity

            People

              mohitsabharwal Mohit Sabharwal
              mohitsabharwal Mohit Sabharwal
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: