【问题标题】:Hive -> Kafka: Insert into hive kafka integration external table failedHive -> Kafka:插入 hive kafka 集成外部表失败
【发布时间】:2020-06-17 18:35:06
【问题描述】:
#Exception I got:
Caused by: java.lang.ClassCastException: org.apache.hadoop.hive.serde2.io.ParquetHiveRecord cannot be cast to org.apache.hadoop.hive.kafka.KafkaWritable

    #create non-native external hive table    
    CREATE EXTERNAL TABLE IF NOT EXISTS weatherHive(lng DOUBLE, lat DOUBLE, avg_tmpr_f DOUBLE, avg_tmpr_c DOUBLE, wthr_date STRING) PARTITIONED BY (year INT, month INT, day INT) TBLPROPERTIES ('kafka.topic' = 'weatherHive', 'kafka.bootstrap.servers'='sandbox-hdp:6667', "kafka.serde.class"="org.apache.hadoop.hive.serde2.avro.AvroSerDe" );
    #insert test data 
    INSERT INTO TABLE weatherHive VALUES (-111,22,80,23,'2016-10-01',2020, 10 ,1 );

然后出现异常,我该怎么办,handler jar 有什么需要做的吗? 我加载到蜂巢中:

add add jar hdfs://sandbox-hdp.hortonworks.com:8020/sandbox/jars/kafka-handler-3.1.2000.7.0.3.0-79.jar;

【问题讨论】:

    标签: hadoop apache-kafka hive integration


    【解决方案1】:

    您可能缺少“org.apache.hadoop.hive.kafka.KafkaSerDe”类。查看this answer。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-03-29
      • 2019-09-18
      • 1970-01-01
      • 1970-01-01
      • 2021-05-22
      • 2019-12-05
      • 2019-03-09
      • 1970-01-01
      相关资源
      最近更新 更多