public abstract class HostUDFWrapper extends Object
This class is used to create the native handle of a host UDF aggregation and is used as a proxy object to compute hash code and compare two host UDF aggregations for equality.
A new host UDF aggregation implementation must extend this class and override the
computeHashCode
and isEqual
methods for such purposes.
Constructor and Description |
---|
HostUDFWrapper() |
Modifier and Type | Method and Description |
---|---|
static void |
closeUDFInstance(long hostUDFInstance)
Close the derived UDF instance created by `createUDFInstance`.
|
abstract int |
computeHashCode() |
abstract long |
createUDFInstance()
Create a derived host UDF native instance.
|
boolean |
equals(Object obj) |
int |
hashCode() |
abstract boolean |
isEqual(Object obj) |
public abstract long createUDFInstance()
Typical usage, refer to Aggregation.java:
long udf = 0; try { udf = wrapper.createUDFInstance(); return Aggregation.createHostUDFAgg(udf); } finally { // a new UDF is cloned in `createHostUDFAgg`, here should close the UDF instance. if (udf != 0) { HostUDFWrapper.closeUDFInstance(udf); } }
public static void closeUDFInstance(long hostUDFInstance)
hostUDFInstance
- the UDF instancepublic abstract int computeHashCode()
public abstract boolean isEqual(Object obj)
Copyright © 2025. All rights reserved.