|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.hive.ql.udf.generic.GenericUDFUtils.ReturnObjectInspectorResolver
public static class GenericUDFUtils.ReturnObjectInspectorResolver
This class helps to find the return ObjectInspector for a GenericUDF. In many cases like CASE and IF, the GenericUDF is returning a value out of several possibilities. However these possibilities may not always have the same ObjectInspector. This class will help detect whether all possibilities have exactly the same ObjectInspector. If not, then we need to convert the Objects to the same ObjectInspector. A special case is when some values are constant NULL. In this case we can use the same ObjectInspector.
Constructor Summary | |
---|---|
GenericUDFUtils.ReturnObjectInspectorResolver()
|
|
GenericUDFUtils.ReturnObjectInspectorResolver(boolean allowTypeConversion)
|
Method Summary | |
---|---|
Object |
convertIfNecessary(Object o,
ObjectInspector oi)
Convert the return Object if necessary (when the ObjectInspectors of different possibilities are not all the same). |
ObjectInspector |
get()
Returns the ObjectInspector of the return value. |
boolean |
update(ObjectInspector oi)
Update returnObjectInspector and valueInspectorsAreTheSame based on the ObjectInspector seen. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GenericUDFUtils.ReturnObjectInspectorResolver()
public GenericUDFUtils.ReturnObjectInspectorResolver(boolean allowTypeConversion)
Method Detail |
---|
public boolean update(ObjectInspector oi) throws UDFArgumentTypeException
UDFArgumentTypeException
public ObjectInspector get()
public Object convertIfNecessary(Object o, ObjectInspector oi)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |