Sahil Takiar has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/14905 )

Change subject: IMPALA-8547: get_json_object fails to get value for numeric key
......................................................................


Patch Set 3:

> This patch LGTM.
 >
 > Hive supports more general keys because it just split the json path
 > by '.' 
 > https://github.com/apache/hive/blob/ba0217ff17501fb849d8999e808d37579db7b4f1/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFJson.java#L147
 > So this is also workable in Hive:
 >
 > select get_json_object('{"hello world": 5}', '$.hello world');
 >
 > It can't work in Impala because "hello world" is not a legal
 > variable name.
 > I think if we want the compatibility with Hive we can create a JIRA
 > to refactor the json patch parsing logics.

I filed IMPALA-9993 as a follow up. I think this requires some more thought. 
That SQL statement is valid in Postgres, but not MySQL. It seems all databases 
have a slightly different way of handling JSON. The Hive / Impala syntax seems 
to be some combination of Postgres / MySQL behavior, which is a bit odd.


--
To view, visit http://gerrit.cloudera.org:8080/14905
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7df037ccf2c79da0ba86a46df1dd28ab0e9a45f4
Gerrit-Change-Number: 14905
Gerrit-PatchSet: 3
Gerrit-Owner: Eugene Zimichev <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Quanlong Huang <[email protected]>
Gerrit-Reviewer: Sahil Takiar <[email protected]>
Gerrit-Reviewer: Tim Armstrong <[email protected]>
Gerrit-Comment-Date: Wed, 22 Jul 2020 22:47:27 +0000
Gerrit-HasComments: No

Reply via email to