Hello, Developers!
I used the Cloudera Hadoop 5.13.1, the version of Hive 0.14.
Json-serde-cdh5-shim-1.3.9-SNAPSHOT.jar was added to Hadoop cluster.
I use a schema for our JSON files:
A table has been created succesfully, but SELECT from the empty table causes an error:
Click to expand
```
Error: Error while compiling statement: FAILED: IllegalArgumentException Error: : expected at the end of 'struct,keycode:string,cash_number:int,hostname:string,kkm_model_name:string,kkm_model_version:string,eklz_act_date:struct,free_kkm_fm:int,end_time:struct>>,kkm_serial:string,shift_number:string>:struct,im_order:struct>>>,packets_count:int>>,create_time:struct,save_time:struct,readonly:boolean,deleted:boolean,history:struct,keycode:string>>>>,assistant:string,content:struct,nds_sum:double,save_time:struct,round:int,excise_mark:array>>>>,hist_content:struct,code:string,quant:double,old_quant:double,price:double,keycode:string>>>>,cashless:struct,term_num:string,point_num:string,auth_code:string,card_app:string,card_num:string,opsum:double,slip:struct>,nominal:double>>>>,card:struct>>>,present:struct>>>,coupons:struct>>>>,correct_paysystem:boolean,cashsum:double,round_sum:double,discount:double,discount_actions:struct,format:string,count:int,sum:double,arts:struct,code:string,price:double,discount:double,quantity:double,parent_action_id:struct,parent_id:struct>>>>,receipt_text:string>>>>,stickers_count:int,sticker_actions:struct,format:string,count:int,receipt_text:string>>>>,information_action:struct,format:string,count:int,receipt_text:string>>>>,coupons_count:int,coupons_actions:struct,format:string,short_code:string,count:int,receipt_text:string>>>>,smch_actions:struct>>>>>>>,approved_misc_params:struct>,discounted_unique_coupons:struct>>>>,result:boolean,error:boolean,message:boolean,actions:struct>>>>,save_time:struct>>>,generated_unique_coupons:struct,receipt_text:string,barcodes:struct>>>>>>>,buyer_souvenirs:struct>>>,loyalty_cards:struct>>>>,produced_loyalty_cards:struct>>>>,egais_slips:struct,number:int,xml_check:string,arts:struct>>>>>>>,check_params:struct>,number:string,sale_number:string,sale_id:struct,fiscal_number:string,fiscal_sign:string,cashsum:double,retsum:double,cashless_sum:double,cashless_ret:double,creditsum'
SQLState: 42000
ErrorCode: 40000
```
If I remove several partitions from the schema, SELECT works without errors.
Hello, Developers! I used the Cloudera Hadoop 5.13.1, the version of Hive 0.14. Json-serde-cdh5-shim-1.3.9-SNAPSHOT.jar was added to Hadoop cluster. I use a schema for our JSON files:
Click to expand
``` CREATE TABLE TEST.T_TXN_JSON_SERDE ( shift struct < shift:struct < array:struct < begin_time:struct < datetime:string > ,keycode:string ,cash_number:int ,hostname:string ,kkm_model_name:string ,kkm_model_version:string ,eklz_act_date:struct < datetime:string > ,free_kkm_fm:int ,end_time:struct < datetime:string > > > ,kkm_serial:string ,shift_number:string > ,operation struct < operation:struct < array:struct < module_version:string ,point_code:string ,optype:string ,wholesale_number:string ,wholesale_contr:string ,wholesale_opguid:struct < guid:string > ,im_order:struct < array:struct < number:string ,packets:struct < table:struct < rows:array < struct < code:string ,price:double ,quant:double > > > > ,packets_count:int > > ,create_time:struct < datetime:string > ,save_time:struct < datetime:string > ,readonly:boolean ,deleted:boolean ,history:struct < table:struct < rows:array < struct < action:string ,act_time:struct < datetime:string > ,keycode:string > > > > ,assistant:string ,content:struct < table:struct < rows:array < struct < code:string ,quant:double ,price:double ,nds_rate:struct < guid:string > ,nds_sum:double ,save_time:struct < datetime:string > ,round:int ,excise_mark:arrayA table has been created succesfully, but SELECT from the empty table causes an error:
Click to expand
``` Error: Error while compiling statement: FAILED: IllegalArgumentException Error: : expected at the end of 'structIf I remove several partitions from the schema, SELECT works without errors.
How to avoid this problem?