- 
                Notifications
    
You must be signed in to change notification settings  - Fork 37
 
UDF
        Jolan Rensen edited this page Jul 29, 2022 
        ·
        12 revisions
      
    See the examples in code.
A(BCD)EF:
- 
A(xor)- 
udfto just create a (vararg) UDF - 
udafto just create a UDAF - 
udafUnnamedto create an unnamed UDAF (for whenudaffails to get a name from the Aggregator) - 
udf.registerto immediately create and register a (vararg) UDF or UDAF. RequiresBor requiresCto be aNamedUserDefinedFunction, anAggregator, or a (vararg) UDF / UDAF function reference. 
 - 
 - 
B- 
name. AString. Optional unless registering an unnamed (vararg) UDF or UDAF. Provides (new) name for the (vararg) UDF or UDAF. 
 - 
 - 
C(xor withE)- 
namedUdf. ANamedUserDefinedFunction(Vararg), requiresAto beudaf.register(will provide name). - 
udf. AUserDefinedFunction(Vararg), requiresAto beudaf.registerand requiresB(will provide name). - 
func. A UDF- or UDAF function reference (will provide name based onfunc). - 
varargFunc. A vararg UDF function reference. RequiresAto be NOTudf(will provide name based onvarargFunc). - 
agg. AnAggregator(can be created usingaggregatorOf()) to create a UDAF. RequiresAto be NOTudf(will provide name based onagg). - 
zero,reduce,merge,finish, OptionalbufferEncoder, OptionaloutputEncoder. Creates UDAF in place instead of usingagg(will provide name, "Aggregator" by default). 
 - 
 - 
D- 
nondeterministic. A Boolean. Optional, defaults tofalse. Updates (vararg) UDF or UDAF to non-deterministic. For instance, for randomization. 
 - 
 - 
E(xor withC)- 
func. An in-place UDF lambda (won't provide name, unless specified inBorF). - 
varargFunc. An in-place vararg UDF lambda (= takes a single array as parameter) (won't provide name, unless specified inBorF). 
 - 
 - 
F(Optional, or)- 
.register(). Will register the (vararg) UDF or UDAF. RequiresBor requiresCto be aNamedUserDefinedFunction, anAggregator, or a (vararg) UDF / UDAF function reference. - 
.register(name: String). Will register the (vararg) UDF or UDAF with (new) name. - 
.withName(name: String). Will give the (named) udf the (new) namename. 
 -