You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Panagiotis Garefalakis (Jira)" <ji...@apache.org> on 2021/09/20 16:01:00 UTC

[jira] [Updated] (HIVE-25541) JsonSerDe: TBLPROPERTY treating nested json as String

     [ https://issues.apache.org/jira/browse/HIVE-25541?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Panagiotis Garefalakis updated HIVE-25541:
------------------------------------------
    Description: 
Native Jsonserde 'org.apache.hive.hcatalog.data.JsonSerDe' currently does not support loading nested json into a string type directly. It requires the declaring the column as complex type (struct, map, array) to unpack nested json data.

Even though the data field is not a valid JSON String type there is value treating it as plain String instead of throwing an exception as we currently do.

{code:java}
create table json_table(data string, messageid string, publish_time bigint, attributes string);

{"data":{"H":{"event":"track_active","platform":"Android"},"B":{"device_type":"Phone","uuid":"[36ffec24-f6a4-4f5d-aa39-72e5513d2cae,11883bee-a7aa-4010-8a66-6c3c63a73f16]"}},"messageId":"2475185636801962","publish_time":1622514629783,"attributes":{"region":"IN"}}"}}
{code}

This JIRA introduces an extra Table Property allowing to Stringify Complex JSON values instead of forcing the User to define the complete nested structure

  was:
Native Jsonserde 'org.apache.hive.hcatalog.data.JsonSerDe' currently does not support loading nested json into a string type directly. It requires the declaring the column as complex type (struct, map, array) to unpack nested json data.

Even though the data field is not a valid JSON String type there is value treating it as plain String instead of throwing an exception as we currently do.

{code:java}
create table json_table(data string, messageid string, publish_time bigint, attributes string);

{"data":{"H":{"event":"track_active","platform":"Android"},"B":{"device_type":"Phone","uuid":"[36ffec24-f6a4-4f5d-aa39-72e5513d2cae,11883bee-a7aa-4010-8a66-6c3c63a73f16]"}},"messageId":"2475185636801962","publish_time":1622514629783,"attributes":{"region":"IN"}}"}}
{code}

This JIRA introduces an extra Table property allowing to Stringify Complex JSON values instead of forcing the User to define the complete nested structure


> JsonSerDe: TBLPROPERTY treating nested json as String
> -----------------------------------------------------
>
>                 Key: HIVE-25541
>                 URL: https://issues.apache.org/jira/browse/HIVE-25541
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Panagiotis Garefalakis
>            Assignee: Panagiotis Garefalakis
>            Priority: Major
>
> Native Jsonserde 'org.apache.hive.hcatalog.data.JsonSerDe' currently does not support loading nested json into a string type directly. It requires the declaring the column as complex type (struct, map, array) to unpack nested json data.
> Even though the data field is not a valid JSON String type there is value treating it as plain String instead of throwing an exception as we currently do.
> {code:java}
> create table json_table(data string, messageid string, publish_time bigint, attributes string);
> {"data":{"H":{"event":"track_active","platform":"Android"},"B":{"device_type":"Phone","uuid":"[36ffec24-f6a4-4f5d-aa39-72e5513d2cae,11883bee-a7aa-4010-8a66-6c3c63a73f16]"}},"messageId":"2475185636801962","publish_time":1622514629783,"attributes":{"region":"IN"}}"}}
> {code}
> This JIRA introduces an extra Table Property allowing to Stringify Complex JSON values instead of forcing the User to define the complete nested structure



--
This message was sent by Atlassian Jira
(v8.3.4#803005)