Troubleshooting hive Error: Org.apache.hadoop.hive.serde2.SerDeException:java.io.IOException:Start of Array expected

Source: Internet
Author: User

CREATE TABLEJson_nested_test (Countstring, usage string, pkg map<String,string>, Languages array<String>, store map<String,array<Map<String,string>>>) ROW FORMAT SERDE'org.apache.hive.hcatalog.data.JsonSerDe'STORED asTextfile;

After creating the table Json_nested_test in the SQL above, the query found an error: failed with Exception Java. Io. Ioexception:org.. Hadoop. Hive. Serde2. Serdeexception: Java.. Ioexception: start Array expected

As a result of the following tests, it is found that org.apache.hive.hcatalog.data.JsonSerDe is insufficient for complex type support, such as MAP&LT;STRING,ARRAY&LT;STRING&GT;&GT; In this example, array as the value of map is not supported.
CREATE TABLEJson_nested_test_openx (Countstring, usage string, pkg map<String,string>, Languages array<String>, store map<String,array<Map<String,string>>>) ROW FORMAT SERDE'org.openx.data.jsonserde.JsonSerDe'STORED astextfile;CREATE TABLES1 (Countstring, usage string) ROW FORMAT SERDE'org.apache.hive.hcatalog.data.JsonSerDe'STORED astextfile;LoadData local Inpath'/home/work/s1.txt'Overwrite into TableS1;Select *  fromS1;CREATE TABLES2 (Countstring, usage string, pkg map<String,string>) ROW FORMAT SERDE'org.apache.hive.hcatalog.data.JsonSerDe'STORED astextfile;LoadData local Inpath'/home/work/s2.txt'Overwrite into TableS2;Select *  fromS2;CREATE TABLES3 (Countstring, usage string, pkg map<String,string>, Languages array<String>) ROW FORMAT SERDE'org.apache.hive.hcatalog.data.JsonSerDe'STORED astextfile;LoadData local Inpath'/home/work/s3.txt'Overwrite into TableS3;Select *  fromS3;CREATE TABLES4 (Countstring, usage string, pkg map<String,string>, Languages array<String>, store map<String,array<Map<String,string>>>) ROW FORMAT SERDE'org.apache.hive.hcatalog.data.JsonSerDe'STORED astextfile;LoadData local Inpath'/home/work/s4.txt'Overwrite into TableS4;Select *  fromS4;CREATE TABLES5 (Store map<String,array<Map<String,string>>>) ROW FORMAT SERDE'org.apache.hive.hcatalog.data.JsonSerDe'STORED astextfile;LoadData local Inpath'/home/work/s5.txt'Overwrite into TableS5;Select *  fromS5;CREATE TABLES6 (Store map<String,array<String>>) ROW FORMAT SERDE'org.apache.hive.hcatalog.data.JsonSerDe'STORED astextfile;LoadData local Inpath'/home/work/s6.txt'Overwrite into TableS6;Select *  fromS6;

This Serde HIVE comes with a path of $hive_home/hcatalog/share/hcatalog/hive-hcatalog-core-1.2.1.jar, and it has other problems: empty rows in the data file are not supported

Troubleshooting hive Error: Org.apache.hadoop.hive.serde2.SerDeException:java.io.IOException:Start of Array expected

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.