答案 0 :(得分:0)
创建新的UDF有两个步骤
1创建UDF link
2 Register UDF。
即你有UDF签名
long Dt_TIME_ADD(string time,
string duration
[, string default_timezone = 'UTC'])
Here 1 Long is return type
2 TIME_ADD is UDF Name
3 Parms time ,duration and Default parm default_timezone
这可以称为
SELECT ... WHERE TD_TIME_RANGE(time,
'2013-01-01',
TD_TIME_ADD('2013-01-01', '1d'))
答案 1 :(得分:0)
像这样定义输出函数:
@OutputFunction("row(name double,some double)")
public static void output(SomeState state, BlockBuilder out){
BlockBuilder blockBuilder = DoubleType.DOUBLE.createBlockBuilder(new BlockBuilderStatus(), 1);
DoubleType.DOUBLE.writeDouble(blockBuilder, 1.0);
DoubleType.DOUBLE.writeDouble(blockBuilder, 2.0);
Block block = blockBuilder.build();
out.writeObject(block);
out.closeEntry();
}
在这里,我们定义行(名称类型)的参数类型