java.io.IOException: java.lang.ClassCastException: org.apache.hadoop.hive.serde2.objectinspector.StandardListObjectInspector cannot be cast to org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector

Apache's JIRA Issue Tracker | Anthony Hsu | 3 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    To reproduce: {code} create table testarray (a array<string>); load data local inpath '/home/ahsu/test/array.txt' into table testarray; # create partitioned Avro table with one array column create table avroarray partitioned by (y string) row format serde 'org.apache.hadoop.hive.serde2.avro.AvroSerDe' with serdeproperties ('avro.schema.literal'='{"namespace":"test","name":"avroarray","type": "record", "fields": [ { "name":"a", "type":{"type":"array","items":"string"} } ] }') STORED as INPUTFORMAT 'org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat'; insert into table avroarray partition(y=1) select * from testarray; # add an int column with a default value of 0 alter table avroarray set serde 'org.apache.hadoop.hive.serde2.avro.AvroSerDe' with serdeproperties('avro.schema.literal'='{"namespace":"test","name":"avroarray","type": "record", "fields": [ {"name":"intfield","type":"int","default":0},{ "name":"a", "type":{"type":"array","items":"string"} } ] }'); # fails with ClassCastException select * from avroarray; {code} The select * fails with: {code} Failed with exception java.io.IOException:java.lang.ClassCastException: org.apache.hadoop.hive.serde2.objectinspector.StandardListObjectInspector cannot be cast to org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector {code}

    Apache's JIRA Issue Tracker | 3 years ago | Anthony Hsu
    java.io.IOException: java.lang.ClassCastException: org.apache.hadoop.hive.serde2.objectinspector.StandardListObjectInspector cannot be cast to org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector
  2. 0

    [HIVE-4494] ORC map columns get class cast exception in some context - ASF JIRA

    apache.org | 1 year ago
    java.lang.RuntimeException: Error in configuring object
  3. 0

    Issues using Parquet Files with Hive

    Google Groups | 3 years ago | Samuel Dehouck
    java.lang.RuntimeException: Error in configuring object
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      org.apache.hadoop.hive.serde2.objectinspector.StandardListObjectInspector cannot be cast to org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector

      at org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorConverters.getConverter()
    2. Hive Serde
      ObjectInspectorConverters.getConverter
      1. org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorConverters.getConverter(ObjectInspectorConverters.java:148)
      2. org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorConverters$StructConverter.<init>(ObjectInspectorConverters.java:304)
      3. org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorConverters.getConverter(ObjectInspectorConverters.java:150)
      3 frames
    3. Hive Query Language
      Driver.getResults
      1. org.apache.hadoop.hive.ql.exec.FetchOperator.getRecordReader(FetchOperator.java:407)
      2. org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow(FetchOperator.java:515)
      3. org.apache.hadoop.hive.ql.exec.FetchOperator.pushRow(FetchOperator.java:489)
      4. org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:136)
      5. org.apache.hadoop.hive.ql.Driver.getResults(Driver.java:1471)
      5 frames
    4. org.apache.hadoop
      CliDriver.main
      1. org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:272)
      2. org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:217)
      3. org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:414)
      4. org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:782)
      5. org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:676)
      6. org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:615)
      6 frames
    5. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:597)
      4 frames
    6. Hadoop
      RunJar.main
      1. org.apache.hadoop.util.RunJar.main(RunJar.java:160)
      1 frame