You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Yulei Yang (JIRA)" <ji...@apache.org> on 2017/04/25 11:21:04 UTC

[jira] [Created] (HIVE-16526) JsonSerDe does not support array as map's value

Yulei Yang created HIVE-16526:
---------------------------------

             Summary: JsonSerDe does not support array as map's value
                 Key: HIVE-16526
                 URL: https://issues.apache.org/jira/browse/HIVE-16526
             Project: Hive
          Issue Type: Bug
          Components: HCatalog, Serializers/Deserializers
    Affects Versions: 1.2.1
            Reporter: Yulei Yang
            Priority: Minor


To reproduce the issue do the following:

CREATE TABLE test (
    store map<string,array<string>>
)
ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'
STORED AS TEXTFILE;
load data local inpath '/path/to/s6.txt' overwrite into table test;
select * from test;

The data for s6.txt is below:
{"store":{"fruit":["weight","8","type","apple"]}}
{"store":{"fruit":["weight","9","type","orange"]}}

Error log is:
java.io.IOException: org.apache.hadoop.hive.serde2.SerDeException: java.io.IOException: Start of Array expected
        at org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow(FetchOperator.java:507)
        at org.apache.hadoop.hive.ql.exec.FetchOperator.pushRow(FetchOperator.java:414)
        at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:140)
        at org.apache.hadoop.hive.ql.Driver.getResults(Driver.java:1670)
        at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:233)
        at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:165)
        at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:376)
        at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:736)
        at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:681)
        at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:621)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: org.apache.hadoop.hive.serde2.SerDeException: java.io.IOException: Start of Array expected
        at org.apache.hive.hcatalog.data.JsonSerDe.deserialize(JsonSerDe.java:183)
        at org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow(FetchOperator.java:488)
        ... 15 more



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)