user defined functions - Return Row Type In Presto Udf -
i want implement udf returns me row.
i searched on net, there no example. in source of presto saw methods this takes row data type parameter. there no sample how create row.
thanks.
define output function this:
@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(); }
here, define parameter types row(name type)
wiki
Comments
Post a Comment