CREATE TABLE `jsonTable`(
`bateriaext` bigint,
`bateriaint` bigint,
`blockvehicle` bigint,
`classeeq` bigint,
`cliente` bigint,
`data_posicao` timestamp,
`gps_valido` string,
`horimetro` bigint,
`ibuttonhex` string,
`ibuttonpart1` string,
`ibuttonpart2` string,
`id_motorista` string,
`ignicao` string,
`latitude` double,
`longitude` double,
`odometro` bigint,
`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>>>,
`payload_reefer` array<struct<content:struct<compartment:array<struct<index:bigint,mode:bigint,return_air_state:bigint,return_air_value:bigint,setpoint:string,state:bigint,supply_air_state:bigint,supply_air_value:bigint>>,digital_input:array<struct<index:bigint,state:bigint>>,fuel_level:bigint,fuel_state:bigint,maintenance:array<struct<index:bigint,time:bigint>>,reefer_alarm_number:bigint,reefer_battery_state:bigint,reefer_battery_voltage:bigint,reefer_type:bigint,temperature:array<struct<index:bigint,state:bigint,value:bigint>>,time_electric:bigint,time_engine:bigint,time_standby:bigint,time_switch_on:bigint,unit_city_mode:bigint,unit_power_mode:bigint,unit_run_mode: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_number:bigint,payload_type:bigint,payload_version:bigint,sender_id:bigint,session_number:bigint>>>,
`payload_tpm` array<struct<content:struct<device_position:bigint,device_serial:bigint,high_temperature_thr:bigint,low_pressure_alert_thr:bigint,low_pressure_warning_thr:bigint,nominal_pressure:bigint,sensors:array<struct<alert_battery:boolean,alert_pressure:bigint,alert_temp:boolean,com:bigint,`conf`:bigint,identifier:bigint,index:bigint,mode:bigint,pressure:bigint,status:string,temperature:double>>,system_pairing:bigint>,header:struct<device_type:string,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>>>,
`payload_wsn` array<struct<content:struct<dos:array<struct<battery_status:bigint,counter:bigint,index:bigint,status:bigint>>,tes:array<struct<battery_status:bigint,index:bigint,temperature:double>>,vid:array<struct<battery_status:bigint,id:bigint,index:bigint,status:string,tag:string>>>,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_number:bigint,payload_type:bigint,payload_version:bigint,sender_id:bigint,session_number:bigint>>>,
`pos_memoria` string,
`pyaload_diag` struct<content:struct<battery_charge_level:bigint,battery_charge_state:bigint,battery_temperature:double,battery_voltage:double,can_activity:bigint,can_load:bigint,device_temperature:double,gnss_altitude:bigint,gnss_date_time:struct<date_time:string,epoch:bigint>,gnss_distance:bigint,gnss_hdop:double,gnss_heading:bigint,gnss_latitude:double,gnss_longitude:double,gnss_speed:bigint,gnss_vdop:double,power_source:boolean,scheduled_period:bigint,threshold_hdop:double,threshold_motion:bigint,threshold_unmotion:bigint,vehicle_motion:bigint,vehicle_voltage:double>,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>>,
`veiculo` bigint,
`velocidade` bigint)
PARTITIONED BY (data_posicao_short STRING, veitimezone STRING)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
STORED AS ORC;