org.apache.hadoop.hive.ql.udf
Class UDFJson

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.UDF
      extended by org.apache.hadoop.hive.ql.udf.UDFJson

public class UDFJson
extends UDF

UDFJson.


Constructor Summary
UDFJson()
           
 
Method Summary
 org.apache.hadoop.io.Text evaluate(String jsonString, String pathString)
          Extract json object from a json string based on json path specified, and return json string of the extracted json object.
 
Methods inherited from class org.apache.hadoop.hive.ql.exec.UDF
getRequiredFiles, getRequiredJars, getResolver, setResolver
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UDFJson

public UDFJson()
Method Detail

evaluate

public org.apache.hadoop.io.Text evaluate(String jsonString,
                                          String pathString)
Extract json object from a json string based on json path specified, and return json string of the extracted json object. It will return null if the input json string is invalid. A limited version of JSONPath supported: $ : Root object . : Child operator [] : Subscript operator for array * : Wildcard for [] Syntax not supported that's worth noticing: '' : Zero length string as key .. : Recursive descent @ : Current object/element () : Script expression ?() : Filter (script) expression. [,] : Union operator [start:end:step] : array slice operator

Parameters:
jsonString - the json string.
pathString - the json path expression.
Returns:
json string or null when an error happens.


Copyright © 2014 The Apache Software Foundation. All rights reserved.