org.apache.lens.ml
Class HiveMLUDF
java.lang.Object
org.apache.hadoop.hive.ql.udf.generic.GenericUDF
org.apache.lens.ml.HiveMLUDF
- All Implemented Interfaces:
- Closeable
public final class HiveMLUDF
- extends org.apache.hadoop.hive.ql.udf.generic.GenericUDF
Generic UDF to laod ML Models saved in HDFS and apply the model on list of columns passed as argument.
Nested classes/interfaces inherited from class org.apache.hadoop.hive.ql.udf.generic.GenericUDF |
org.apache.hadoop.hive.ql.udf.generic.GenericUDF.DeferredJavaObject, org.apache.hadoop.hive.ql.udf.generic.GenericUDF.DeferredObject |
Field Summary |
static org.apache.commons.logging.Log |
LOG
The Constant LOG. |
static String |
UDF_NAME
The Constant UDF_NAME. |
Method Summary |
void |
configure(org.apache.hadoop.hive.ql.exec.MapredContext context)
|
Object |
evaluate(org.apache.hadoop.hive.ql.udf.generic.GenericUDF.DeferredObject[] deferredObjects)
|
String |
getDisplayString(String[] strings)
|
org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector |
initialize(org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector[] objectInspectors)
Currently we only support double as the return value. |
Methods inherited from class org.apache.hadoop.hive.ql.udf.generic.GenericUDF |
close, copyToNewInstance, flip, getRequiredFiles, getRequiredJars, getUdfName, initializeAndFoldConstants |
UDF_NAME
public static final String UDF_NAME
- The Constant UDF_NAME.
- See Also:
- Constant Field Values
LOG
public static final org.apache.commons.logging.Log LOG
- The Constant LOG.
initialize
public org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector initialize(org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector[] objectInspectors)
throws org.apache.hadoop.hive.ql.exec.UDFArgumentException
- Currently we only support double as the return value.
- Specified by:
initialize
in class org.apache.hadoop.hive.ql.udf.generic.GenericUDF
- Parameters:
objectInspectors
- the object inspectors
- Returns:
- the object inspector
- Throws:
org.apache.hadoop.hive.ql.exec.UDFArgumentException
- the UDF argument exception
evaluate
public Object evaluate(org.apache.hadoop.hive.ql.udf.generic.GenericUDF.DeferredObject[] deferredObjects)
throws org.apache.hadoop.hive.ql.metadata.HiveException
- Specified by:
evaluate
in class org.apache.hadoop.hive.ql.udf.generic.GenericUDF
- Throws:
org.apache.hadoop.hive.ql.metadata.HiveException
getDisplayString
public String getDisplayString(String[] strings)
- Specified by:
getDisplayString
in class org.apache.hadoop.hive.ql.udf.generic.GenericUDF
configure
public void configure(org.apache.hadoop.hive.ql.exec.MapredContext context)
- Overrides:
configure
in class org.apache.hadoop.hive.ql.udf.generic.GenericUDF
Copyright © 2014–2015 Apache Software Foundation. All rights reserved.