[ 
https://issues.apache.org/jira/browse/HIVE-11825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14746878#comment-14746878
 ] 

Cazen Lee commented on HIVE-11825:
----------------------------------

I searched a while and guess it's your JSON problem.

First of all, your JSON string was something wrong(it means it's not standard)

And hive has strict rule when reading JSON format(excption occured when wrong 
escape)

So, If you want to read your JSON files
- Convert and validate your escape character(ex. from \ to \\) when it created
- OR write custom UDF extend UDFJson with 
ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER enabled(recommended)

Not sure it's OK that added ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER enabled in 
trunk(If can, Could I participate?)
Hive has many history and discussed by people, so I think there are reason that 
strict JSON rules.

If I'm wrong or any suggestions, please let me know.

Thank you

> get_json_object(col,'$.a') is null in where clause didn`t work
> --------------------------------------------------------------
>
>                 Key: HIVE-11825
>                 URL: https://issues.apache.org/jira/browse/HIVE-11825
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>    Affects Versions: 0.14.0
>            Reporter: Feng Yuan
>            Priority: Critical
>             Fix For: 0.14.1
>
>
> example:
> select attr from raw_kafka_item_dt0 where l_date='2015-09-06' and 
> customer='Czgc_news' and get_json_object(attr,'$.title') is NULL limit 10;
> but in results,title is still not null!
> {"title":"思科Q4收入估$79.2亿 
> 前景阴云笼罩","ItemType":"NewsBase","keywords":"思科Q4收入估\$79.2亿 
> 前景阴云笼罩","random":"1420253511075","callback":"BCore.instances[2].callbacks[1]","user_agent":"Mozilla/5.0
>  (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 
> (KHTML; like Gecko) Version/5.0.2 Mobile/8C148 
> Safari/6533.18.5","is_newgid":"false","uuid":"DS.Input:b56c782bcb75035d:00002116:003dcd40:54a75947","ptime":"1.1549997E9"}
>  
> attr is a dict



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to