hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean McNamara (Updated) (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-2927) Allow escape character in get_json_object
Date Thu, 05 Apr 2012 17:52:24 GMT

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

Sean McNamara updated HIVE-2927:
--------------------------------

    Description: 
*Background:*
get_json_object extracts json objects from a json string based on a specified path.


*Problem:*
The current implementation of get_json_object can't see keys with a '.' in them.  Our data
contains '.' in the keys, so we have to filter our json keys through a streaming script to
replace '.' for '_'.


*Example:*
{{json = {"a":{"b": 1}, "c.d": 2}}}

{{get_json_object(json, "a.b") returns: 1}}
{{get_json_object(json, "c.d") returns: NULL}}

In the present implementation of get_json_object, c.d is not addressable.


*Proposal:*
The desired behavior would be to allow the JSON path to be escape-able, like so:

{{get_json_object(json, '$.c\\\.d') would return: 2}}

  was:
*Background:*
get_json_object extracts json objects from a json string based on a specified path.


*Problem:*
The current implementation of get_json_object can't see keys with a '.' in them.  Our data
contains '.' in the keys, so we have to filter our json keys through a streaming script to
replace '.' for '_'.


*Example:*
{{json = {"a":{"b": 1}, "c.d": 2}}}

{{get_json_object(json, "a.b") returns: 1}}
{{get_json_object(json, "c.d") returns: NULL}}

In the present implementation of get_json_object, c.d is not addressable.


*Proposal:*
The desired behavior would be to allow the JSON path to be escape-able, like so:

{{get_json_object(json, '$.c\\\\.d') would return: 2}}

    
> Allow escape character in get_json_object
> -----------------------------------------
>
>                 Key: HIVE-2927
>                 URL: https://issues.apache.org/jira/browse/HIVE-2927
>             Project: Hive
>          Issue Type: Improvement
>          Components: Security
>            Reporter: Sean McNamara
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> *Background:*
> get_json_object extracts json objects from a json string based on a specified path.
> *Problem:*
> The current implementation of get_json_object can't see keys with a '.' in them.  Our
data contains '.' in the keys, so we have to filter our json keys through a streaming script
to replace '.' for '_'.
> *Example:*
> {{json = {"a":{"b": 1}, "c.d": 2}}}
> {{get_json_object(json, "a.b") returns: 1}}
> {{get_json_object(json, "c.d") returns: NULL}}
> In the present implementation of get_json_object, c.d is not addressable.
> *Proposal:*
> The desired behavior would be to allow the JSON path to be escape-able, like so:
> {{get_json_object(json, '$.c\\\.d') would return: 2}}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message