@Internal public class HiveGenericUDTF extends org.apache.flink.table.functions.TableFunction<org.apache.flink.types.Row> implements HiveFunction
GenericUDTF.| 构造器和说明 |
|---|
HiveGenericUDTF(HiveFunctionWrapper<org.apache.hadoop.hive.ql.udf.generic.GenericUDTF> hiveFunctionWrapper,
HiveShim hiveShim) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
void |
eval(Object... args) |
org.apache.flink.table.types.DataType |
getHiveResultType(Object[] constantArguments,
org.apache.flink.table.types.DataType[] argTypes)
Get result type by arguments and argTypes.
|
org.apache.flink.api.common.typeinfo.TypeInformation |
getResultType() |
void |
open(org.apache.flink.table.functions.FunctionContext context) |
void |
setArgumentTypesAndConstants(Object[] constantArguments,
org.apache.flink.table.types.DataType[] argTypes)
Set arguments and argTypes for Function instance.
|
protected void |
setCollector(org.apache.hadoop.hive.ql.udf.generic.Collector collector) |
collect, getKind, getParameterTypes, setCollectorpublic HiveGenericUDTF(HiveFunctionWrapper<org.apache.hadoop.hive.ql.udf.generic.GenericUDTF> hiveFunctionWrapper, HiveShim hiveShim)
public void open(org.apache.flink.table.functions.FunctionContext context)
throws Exception
open 在类中 org.apache.flink.table.functions.UserDefinedFunctionException@VisibleForTesting protected final void setCollector(org.apache.hadoop.hive.ql.udf.generic.Collector collector)
public void eval(Object... args) throws org.apache.hadoop.hive.ql.metadata.HiveException
org.apache.hadoop.hive.ql.metadata.HiveExceptionpublic void setArgumentTypesAndConstants(Object[] constantArguments, org.apache.flink.table.types.DataType[] argTypes)
HiveFunctionsetArgumentTypesAndConstants 在接口中 HiveFunctionconstantArguments - arguments of a function call (only literal arguments
are passed, nulls for non-literal ones)argTypes - types of argumentspublic org.apache.flink.table.types.DataType getHiveResultType(Object[] constantArguments, org.apache.flink.table.types.DataType[] argTypes)
HiveFunctionWe can't use getResultType(Object[], Class[]). The Class[] is the classes of what is defined in eval(), for example, if eval() is "public Integer eval(Double)", the argTypes would be Class[Double]. However, in our wrapper, the signature of eval() is "public Object eval(Object... args)", which means we cannot get any info from the interface.
getHiveResultType 在接口中 HiveFunctionconstantArguments - arguments of a function call (only literal arguments
are passed, nulls for non-literal ones)argTypes - types of argumentspublic org.apache.flink.api.common.typeinfo.TypeInformation getResultType()
getResultType 在类中 org.apache.flink.table.functions.TableFunction<org.apache.flink.types.Row>Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.