Zhiwen Sun created HIVE-6301:
--------------------------------
Summary: get_json_object throw java.lang.IllegalStateException: No
match found exception.
Key: HIVE-6301
URL: https://issues.apache.org/jira/browse/HIVE-6301
Project: Hive
Issue Type: Bug
Affects Versions: 0.12.0, 0.11.0, 0.10.0
Reporter: Zhiwen Sun
Priority: Critical
In fact, you can find the bug in code.
https://github.com/apache/hive/blob/branch-0.10/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFJson.java#L190
Miss call _mKey.matches()_ before use _mKey.group(1)_
The bug still exists in the newest version.
So, we met such exception in some query:
{quote}
2014-01-23 11:08:19,869 FATAL ExecReducer:
org.apache.hadoop.hive.ql.metadata.HiveException: Unable to execute method
public org.apache.hadoop.io.Text
org.apache.hadoop.hive.ql.udf.UDFJson.evaluate(java.lang.String,java.lang.String)
on object org.apache.hadoop.hive.ql.udf.UDFJson@c7056d5 of class
org.apache.hadoop.hive.ql.udf.UDFJson with arguments {{ ....
}:java.lang.String, $.6:java.lang.String} of size 2
Caused by: java.lang.IllegalStateException: No match found
at java.util.regex.Matcher.group(Matcher.java:468)
at org.apache.hadoop.hive.ql.udf.UDFJson.extract(UDFJson.java:190)
at org.apache.hadoop.hive.ql.udf.UDFJson.evaluate(UDFJson.java:154)
... 24 more
{quote}
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)