Hi all,

i am trying to update a complex type column schema in a ORC Hive table. My
column 'payload' is defined as following:

array<struct<content:struct<11_msg_counter:bigint,12_msg_counter:bigint,21_msg_counter:bigint,22_msg_counter:bigint,23_msg_counter:bigint,abs_active_towed_counter:bigint,abs_active_towing_counter:bigint,abs_off_road_counter:bigint,amber_warning_signal_counter:bigint,auto_towed_veh_brake_counter:bigint,axle_load_sum_max:bigint,axle_load_sum_mean:bigint,axle_load_sum_min:bigint,brake_light_counter:bigint,brake_lining_counter:bigint,brake_lining_max:bigint,brake_lining_mean:bigint,brake_lining_min:bigint,brake_temperature_max:bigint,brake_temperature_mean:bigint,brake_temperature_min:bigint,brake_temperature_status_counter:bigint,lateral_acc_max:double,lateral_acc_mean:double,lateral_acc_min:double,loading_ramp_counter:bigint,red_warning_signal_counter:bigint,rop_system_counter:bigint,service_brake_counter:bigint,service_brake_demand_max:double,service_brake_demand_mean:double,service_brake_demand_min:double,supply_line_braking_counter:bigint,vdc_active_towed_counter:bigint,vdc_active_towing_counter:bigint,veh_electrical_supply_counter:bigint,veh_pneumatic_supply_counter:bigint,wheel_based_speed_towed_max:double,wheel_based_speed_towed_mean:double,wheel_based_speed_towed_min:double,wheel_based_speed_towing_max:double,wheel_based_speed_towing_mean:double,wheel_based_speed_towing_min:double,yc_system_counter:bigint>,header:struct<generation_number:bigint,message_arrival_date:struct<date_time:string,epoch:bigint>,message_date_time:struct<date_time:string,epoch:bigint>,owner_id:bigint,payload_cause:bigint,payload_number:bigint,payload_type:bigint,payload_version:bigint,sender_id:bigint,session_number:bigint,test_parameter:bigint>>>



When i try to updade the schema by adding a new column to the struct above
using the following command:

ALTER TABLE POSITIONS CHANGE COLUMN PAYLOAD_EBS PAYLOAD_EBS
array<struct<content:struct<11_msg_counter:bigint,12_msg_counter:bigint,21_msg_counter:bigint,22_msg_counter:bigint,23_msg_counter:bigint,abs_active_towed_counter:bigint,abs_active_towing_counter:bigint,abs_off_road_counter:bigint,amber_warning_signal_counter:bigint,auto_towed_veh_brake_counter:bigint,axle_load_sum_max:bigint,axle_load_sum_mean:bigint,axle_load_sum_min:bigint,brake_light_counter:bigint,brake_lining_counter:bigint,brake_lining_max:bigint,brake_lining_mean:bigint,brake_lining_min:bigint,brake_temperature_max:bigint,brake_temperature_mean:bigint,brake_temperature_min:bigint,brake_temperature_status_counter:bigint,lateral_acc_max:double,lateral_acc_mean:double,lateral_acc_min:double,loading_ramp_counter:bigint,red_warning_signal_counter:bigint,rop_system_counter:bigint,service_brake_counter:bigint,service_brake_demand_max:double,service_brake_demand_mean:double,service_brake_demand_min:double,supply_line_braking_counter:bigint,vdc_active_towed_counter:bigint,vdc_active_towing_counter:bigint,veh_electrical_supply_counter:bigint,veh_pneumatic_supply_counter:bigint,wheel_based_speed_towed_max:double,wheel_based_speed_towed_mean:double,wheel_based_speed_towed_min:double,wheel_based_speed_towing_max:double,wheel_based_speed_towing_mean:double,wheel_based_speed_towing_min:double,yc_system_counter:bigint>,header:struct<generation_number:bigint,message_arrival_date:struct<date_time:string,epoch:bigint>,message_date_time:struct<date_time:string,epoch:bigint>,owner_id:bigint,payload_cause:bigint,payload_number:bigint,payload_type:bigint,payload_version:bigint,sender_id:bigint,session_number:bigint,
*test_parameter:bigint*>>>;

i got the the error every time:

FAILED: Execution Error, return code 1 from
org.apache.hadoop.hive.ql.exec.DDLTask. Unable to alter table. The
following columns have types incompatible with the existing columns in
their respective positions :PAYLOAD_EBS



I would like to know what i am doing wrong or what is the other options to
update the schema of a complex type like this.

Thanks in advance.

Best regards,
kadu.

Reply via email to