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

Carl Steinbach updated HIVE-1528:
---------------------------------

    Description: 
Currently the only way to evaluate a path expression on a JSON object is 
through get_json_object. If there are many fields in the JSON object need to be 
extract, we have to call this UDF multiple times. 

There are many use cases that get_json_object needs to be called many times in 
one query to convert the JSON object to a relational schema. It would be much 
desirable if we have a JSON UDTF that supports the following syntax:

{code}
select a.id, b.*
from a lateral view json_tuple(a.json_str, '$.f1',  '$.f2', ..., '$.fn') b as 
f1, f2, ..., fn
{code}

where the json_table function only scans the json_object once and return a set 
of tuple of (f1, f2,..., fn). 


  was:
Currently the only way to evaluate a path expression on a JSON object is 
through get_json_object. If there are many fields in the JSON object need to be 
extract, we have to call this UDF multiple times. 

There are many use cases that get_json_object needs to be called many times in 
one query to convert the JSON object to a relational schema. It would be much 
desirable if we have a JSON UDTF that supports the following syntax:

{code}
select a.id, b.*
from a lateral view json_table(a.json_object, '$.f1',  '$.f2', ..., '$.fn') b 
as f1, f2, ..., fn
{code}

where the json_table function only scans the json_object once and return a set 
of tuple of (f1, f2,..., fn). 



> Add json_tuple() UDTF function
> ------------------------------
>
>                 Key: HIVE-1528
>                 URL: https://issues.apache.org/jira/browse/HIVE-1528
>             Project: Hive
>          Issue Type: New Feature
>          Components: UDF
>    Affects Versions: 0.7.0
>            Reporter: Ning Zhang
>            Assignee: Ning Zhang
>             Fix For: 0.7.0
>
>         Attachments: HIVE-1528.2.patch, HIVE-1528.patch
>
>
> Currently the only way to evaluate a path expression on a JSON object is 
> through get_json_object. If there are many fields in the JSON object need to 
> be extract, we have to call this UDF multiple times. 
> There are many use cases that get_json_object needs to be called many times 
> in one query to convert the JSON object to a relational schema. It would be 
> much desirable if we have a JSON UDTF that supports the following syntax:
> {code}
> select a.id, b.*
> from a lateral view json_tuple(a.json_str, '$.f1',  '$.f2', ..., '$.fn') b as 
> f1, f2, ..., fn
> {code}
> where the json_table function only scans the json_object once and return a 
> set of tuple of (f1, f2,..., fn). 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to