brickhouse.udf.collect
Class ConditionalEmit

java.lang.Object
  extended by org.apache.hadoop.hive.ql.udf.generic.GenericUDTF
      extended by brickhouse.udf.collect.ConditionalEmit

public class ConditionalEmit
extends org.apache.hadoop.hive.ql.udf.generic.GenericUDTF

ConditionalEmit takes an array of booleans and strings, and emits records if the boolean is true. This allows you to emit multiple rows on one pass of the data, rather than doing a union of multiple views with different where clauses. select conditional_emit( array( maxwell_score > 80 , abs( maxwell_score - other.maxwell_score ) < 5, city = "New York" ), array( "CELEB" , "PEER", "NEW_YORKER" ) ) from big_table_which_is_hard_to_sort;


Constructor Summary
ConditionalEmit()
           
 
Method Summary
 void close()
           
 org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector initialize(org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector[] argOIs)
           
 void process(Object[] args)
           
 
Methods inherited from class org.apache.hadoop.hive.ql.udf.generic.GenericUDTF
forward, setCollector
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConditionalEmit

public ConditionalEmit()
Method Detail

initialize

public org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector initialize(org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector[] argOIs)
                                                                               throws org.apache.hadoop.hive.ql.exec.UDFArgumentException
Specified by:
initialize in class org.apache.hadoop.hive.ql.udf.generic.GenericUDTF
Throws:
org.apache.hadoop.hive.ql.exec.UDFArgumentException

process

public void process(Object[] args)
             throws org.apache.hadoop.hive.ql.metadata.HiveException
Specified by:
process in class org.apache.hadoop.hive.ql.udf.generic.GenericUDTF
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException

close

public void close()
           throws org.apache.hadoop.hive.ql.metadata.HiveException
Specified by:
close in class org.apache.hadoop.hive.ql.udf.generic.GenericUDTF
Throws:
org.apache.hadoop.hive.ql.metadata.HiveException


Copyright © 2013. All rights reserved.