Java HiveException:意外异常:org.apache.hadoop.io.Text无法强制转换为org.apache.hadoop.io.IntWritable
我经常面临配置单元查询的强制转换错误。下面给出了一个错误日志示例。错误包含以下详细信息:Java HiveException:意外异常:org.apache.hadoop.io.Text无法强制转换为org.apache.hadoop.io.IntWritable,java,apache,hadoop,hive,hiveql,Java,Apache,Hadoop,Hive,Hiveql,我经常面临配置单元查询的强制转换错误。下面给出了一个错误日志示例。错误包含以下详细信息: 完成行数据 HiveException: Hive Runtime Error while processing row {"company_id":"3M","oper_carrier":"3M","flt_num":"4062","equip_id":"0331","equip_type":"SF3","act_fleet_type_cd":"U","shares_ship_id":"0331"
- 完成行数据
-成本核算异常HiveException: Hive Runtime Error while processing row {"company_id":"3M","oper_carrier":"3M","flt_num":"4062","equip_id":"0331","equip_type":"SF3","act_fleet_type_cd":"U","shares_ship_id":"0331","report_dt":"2013-12-12","origin":"CKB","destination":"IAD"}
Caused by: java.lang.ClassCastException: org.apache.hadoop.io.Text cannot be cast to org.apache.hadoop.io.IntWritable
OK
company_id string
oper_carrier string
flt_num string
equip_id string
equip_type string
act_fleet_type_cd string
shares_ship_id string
report_dt date
origin string
destination string
Detailed Table Information Table(tableName:rvsed11, dbName:DB_123, owner:root, createTime:1452081461, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:company_id, type:string, comment:null), FieldSchema(name:oper_carrier, type:string, comment:null), FieldSchema(name:flt_num, type:string, comment:null), FieldSchema(name:equip_id, type:string, comment:null), FieldSchema(name:equip_type, type:string, comment:null), FieldSchema(name:act_fleet_type_cd, type:string, comment:null), FieldSchema(name:shares_ship_id, type:string, comment:null), FieldSchema(name:report_dt, type:date, comment:null), FieldSchema(name:origin, type:string, comment:null), FieldSchema(name:destination, type:string, comment:null)], location:hdfs://server-D912:9090/user/hive/warehouse/DB_123.db/rvsed11, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=,, field.delim=,}), bucketCols:[], sortCols:[], parameters:{}, skewedInfo:SkewedInfo(skewedColNames:[], skewedColValues:[], skewedColValueLocationMaps:{}), storedAsSubDirectories:false), partitionKeys:[], parameters:{numFiles=1, transient_lastDdlTime=1452081474, COLUMN_STATS_ACCURATE=true, totalSize=1883, numRows=0, rawDataSize=0}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE)
OK
company_id string
equip_id string
shares_ship_id string
seatmap_cd string
cabin string
seat string
seat_loc_dscr string
ep_win_seat int
ep_mid_seat int
ep_asle_seat int
em_win_seat int
em_mid_seat int
em_asle_seat int
ep_seat int
y_win_seat int
y_mid_seat int
y_asle_seat int
fj_win_seat int
fj_mid_seat int
fj_asle_seat int
exit_row int
bulkhead_row int
eff_dt date
disc_dt date
Detailed Table Information Table(tableName:rvsed22, dbName:DB_123, owner:root, createTime:1452081506, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:company_id, type:string, comment:null), FieldSchema(name:equip_id, type:string, comment:null), FieldSchema(name:shares_ship_id, type:string, comment:null), FieldSchema(name:seatmap_cd, type:string, comment:null), FieldSchema(name:cabin, type:string, comment:null), FieldSchema(name:seat, type:string, comment:null), FieldSchema(name:seat_loc_dscr, type:string, comment:null), FieldSchema(name:ep_win_seat, type:int, comment:null), FieldSchema(name:ep_mid_seat, type:int, comment:null), FieldSchema(name:ep_asle_seat, type:int, comment:null), FieldSchema(name:em_win_seat, type:int, comment:null), FieldSchema(name:em_mid_seat, type:int, comment:null), FieldSchema(name:em_asle_seat, type:int, comment:null), FieldSchema(name:ep_seat, type:int, comment:null), FieldSchema(name:y_win_seat, type:int, comment:null), FieldSchema(name:y_mid_seat, type:int, comment:null), FieldSchema(name:y_asle_seat, type:int, comment:null), FieldSchema(name:fj_win_seat, type:int, comment:null), FieldSchema(name:fj_mid_seat, type:int, comment:null), FieldSchema(name:fj_asle_seat, type:int, comment:null), FieldSchema(name:exit_row, type:int, comment:null), FieldSchema(name:bulkhead_row, type:int, comment:null), FieldSchema(name:eff_dt, type:date, comment:null), FieldSchema(name:disc_dt, type:date, comment:null)], location:hdfs://server-D912:9090/user/hive/warehouse/DB_123.db/rvsed22, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=,, field.delim=,}), bucketCols:[], sortCols:[], parameters:{}, skewedInfo:SkewedInfo(skewedColNames:[], skewedColValues:[], skewedColValueLocationMaps:{}), storedAsSubDirectories:false), partitionKeys:[], parameters:{numFiles=1, transient_lastDdlTime=1452081534, COLUMN_STATS_ACCURATE=true, totalSize=14506, numRows=0, rawDataSize=0}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE)
蜂巢>描述扩展rvsed22强>
OK
company_id string
oper_carrier string
flt_num string
equip_id string
equip_type string
act_fleet_type_cd string
shares_ship_id string
report_dt date
origin string
destination string
Detailed Table Information Table(tableName:rvsed11, dbName:DB_123, owner:root, createTime:1452081461, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:company_id, type:string, comment:null), FieldSchema(name:oper_carrier, type:string, comment:null), FieldSchema(name:flt_num, type:string, comment:null), FieldSchema(name:equip_id, type:string, comment:null), FieldSchema(name:equip_type, type:string, comment:null), FieldSchema(name:act_fleet_type_cd, type:string, comment:null), FieldSchema(name:shares_ship_id, type:string, comment:null), FieldSchema(name:report_dt, type:date, comment:null), FieldSchema(name:origin, type:string, comment:null), FieldSchema(name:destination, type:string, comment:null)], location:hdfs://server-D912:9090/user/hive/warehouse/DB_123.db/rvsed11, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=,, field.delim=,}), bucketCols:[], sortCols:[], parameters:{}, skewedInfo:SkewedInfo(skewedColNames:[], skewedColValues:[], skewedColValueLocationMaps:{}), storedAsSubDirectories:false), partitionKeys:[], parameters:{numFiles=1, transient_lastDdlTime=1452081474, COLUMN_STATS_ACCURATE=true, totalSize=1883, numRows=0, rawDataSize=0}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE)
OK
company_id string
equip_id string
shares_ship_id string
seatmap_cd string
cabin string
seat string
seat_loc_dscr string
ep_win_seat int
ep_mid_seat int
ep_asle_seat int
em_win_seat int
em_mid_seat int
em_asle_seat int
ep_seat int
y_win_seat int
y_mid_seat int
y_asle_seat int
fj_win_seat int
fj_mid_seat int
fj_asle_seat int
exit_row int
bulkhead_row int
eff_dt date
disc_dt date
Detailed Table Information Table(tableName:rvsed22, dbName:DB_123, owner:root, createTime:1452081506, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:company_id, type:string, comment:null), FieldSchema(name:equip_id, type:string, comment:null), FieldSchema(name:shares_ship_id, type:string, comment:null), FieldSchema(name:seatmap_cd, type:string, comment:null), FieldSchema(name:cabin, type:string, comment:null), FieldSchema(name:seat, type:string, comment:null), FieldSchema(name:seat_loc_dscr, type:string, comment:null), FieldSchema(name:ep_win_seat, type:int, comment:null), FieldSchema(name:ep_mid_seat, type:int, comment:null), FieldSchema(name:ep_asle_seat, type:int, comment:null), FieldSchema(name:em_win_seat, type:int, comment:null), FieldSchema(name:em_mid_seat, type:int, comment:null), FieldSchema(name:em_asle_seat, type:int, comment:null), FieldSchema(name:ep_seat, type:int, comment:null), FieldSchema(name:y_win_seat, type:int, comment:null), FieldSchema(name:y_mid_seat, type:int, comment:null), FieldSchema(name:y_asle_seat, type:int, comment:null), FieldSchema(name:fj_win_seat, type:int, comment:null), FieldSchema(name:fj_mid_seat, type:int, comment:null), FieldSchema(name:fj_asle_seat, type:int, comment:null), FieldSchema(name:exit_row, type:int, comment:null), FieldSchema(name:bulkhead_row, type:int, comment:null), FieldSchema(name:eff_dt, type:date, comment:null), FieldSchema(name:disc_dt, type:date, comment:null)], location:hdfs://server-D912:9090/user/hive/warehouse/DB_123.db/rvsed22, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=,, field.delim=,}), bucketCols:[], sortCols:[], parameters:{}, skewedInfo:SkewedInfo(skewedColNames:[], skewedColValues:[], skewedColValueLocationMaps:{}), storedAsSubDirectories:false), partitionKeys:[], parameters:{numFiles=1, transient_lastDdlTime=1452081534, COLUMN_STATS_ACCURATE=true, totalSize=14506, numRows=0, rawDataSize=0}, viewOriginalText:null, viewExpandedText:null, tableType:MANAGED_TABLE)
你能为两个表发布一个
descripe TABLE EXTENDED
吗?@robertocangiu:为两个表添加了descripe TABLE EXTENDED。如果需要其他详细信息,请告诉我。您选择的vss表中的最后一列,vss.ep_win_seat
具有与错误显示一致的非整数值。因此,请尝试重新定义vss表中列的数据类型。该列需要一个整数值,因为它获取的是字符串值。因此出现了错误。@KanikeVamshiKrishna可能是正确的,即使错误显示了另一个表中的记录。@KanikeVamshiKrishna您是如何从日志中找出错误是由于vss.ep_win_seat造成的?