背景:目标表结构中,有一个date字段类型设置成了timestamp,数据插入时没有问题,但查询时报以下错误
21/03/11 09:43:12 WARN scheduler.TaskSetManager: Lost task 0.0 in stage 0.0 (TID 0, bd-spark30, executor 2): java.lang.ClassCastException: org.apache.hadoop.io.Text cannot be cast to org.apache.hadoop.hive.serde2.io.TimestampWritable
at org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableTimestampObjectInspector.getPrimitiveJavaObject(WritableTimestampObjectInspector.java:39)
尝试:修改目标表该时间类型字段为date
再次查询,报错:
21/03/11 10:02:15 ERROR thriftserver.SparkSQLDriver: Failed in [select * from cc_ads.t_red_bag_car_outstation_newuser_detail_1d
WHERE dt=20210119]
org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 1.0 failed 4 times, most recent failure: Lost task 0.3 in stage 1.0 (TID 9, bd-spark30, executor 2): java.lang.ClassCastException: org.apache.hadoop.io.Text cannot be cast to org.apache.hadoop.hive.serde2.io.DateWritable
重跑数据