4646 * TODO: Create separate AnalyticFunction class
4747 */
4848public class AggregateFunction extends Function {
49-
49+
5050 private static final Logger LOG = LogManager .getLogger (AggregateFunction .class );
5151 // Set if different from retType_, null otherwise.
5252 private Type intermediateType ;
@@ -91,16 +91,30 @@ protected AggregateFunction() {
9191 }
9292
9393 public AggregateFunction (FunctionName fnName , ArrayList <Type > argTypes , Type retType ,
94- boolean hasVarArgs ) {
95- super (fnName , argTypes , retType , hasVarArgs );
94+ boolean hasVarArgs ) {
95+ this (fnName , argTypes , retType , hasVarArgs , false );
96+ }
97+
98+ public AggregateFunction (FunctionName fnName , ArrayList <Type > argTypes , Type retType ,
99+ boolean hasVarArgs , boolean vectorized ) {
100+ super (fnName , argTypes , retType , hasVarArgs , vectorized );
101+ }
102+
103+ public AggregateFunction (FunctionName fnName , List <Type > argTypes ,
104+ Type retType , Type intermediateType ,
105+ HdfsURI location , String updateFnSymbol , String initFnSymbol ,
106+ String serializeFnSymbol , String mergeFnSymbol , String getValueFnSymbol ,
107+ String removeFnSymbol , String finalizeFnSymbol ) {
108+ this (fnName , argTypes , retType , intermediateType , location , updateFnSymbol , initFnSymbol , serializeFnSymbol ,
109+ mergeFnSymbol , getValueFnSymbol , removeFnSymbol , finalizeFnSymbol , false );
96110 }
97111
98112 public AggregateFunction (FunctionName fnName , List <Type > argTypes ,
99- Type retType , Type intermediateType ,
100- HdfsURI location , String updateFnSymbol , String initFnSymbol ,
101- String serializeFnSymbol , String mergeFnSymbol , String getValueFnSymbol ,
102- String removeFnSymbol , String finalizeFnSymbol ) {
103- super (fnName , argTypes , retType , false );
113+ Type retType , Type intermediateType ,
114+ HdfsURI location , String updateFnSymbol , String initFnSymbol ,
115+ String serializeFnSymbol , String mergeFnSymbol , String getValueFnSymbol ,
116+ String removeFnSymbol , String finalizeFnSymbol , boolean vectorized ) {
117+ super (fnName , argTypes , retType , false , vectorized );
104118 setLocation (location );
105119 this .intermediateType = (intermediateType .equals (retType )) ? null : intermediateType ;
106120 this .updateFnSymbol = updateFnSymbol ;
@@ -121,7 +135,16 @@ public AggregateFunction(FunctionName fnName, List<Type> argTypes,
121135 HdfsURI location , String updateFnSymbol , String initFnSymbol ,
122136 String serializeFnSymbol , String mergeFnSymbol , String getValueFnSymbol ,
123137 String removeFnSymbol , String finalizeFnSymbol ) {
124- super (fnName , argTypes , retType , hasVarArgs );
138+ this (fnName , argTypes , retType , intermediateType , location , updateFnSymbol , initFnSymbol , serializeFnSymbol ,
139+ mergeFnSymbol , getValueFnSymbol , removeFnSymbol , finalizeFnSymbol , false );
140+ }
141+
142+ public AggregateFunction (FunctionName fnName , List <Type > argTypes ,
143+ Type retType , Type intermediateType , boolean hasVarArgs ,
144+ HdfsURI location , String updateFnSymbol , String initFnSymbol ,
145+ String serializeFnSymbol , String mergeFnSymbol , String getValueFnSymbol ,
146+ String removeFnSymbol , String finalizeFnSymbol , boolean vectorized ) {
147+ super (fnName , argTypes , retType , hasVarArgs , vectorized );
125148 setLocation (location );
126149 this .intermediateType = (intermediateType .equals (retType )) ? null : intermediateType ;
127150 this .updateFnSymbol = updateFnSymbol ;
@@ -136,27 +159,47 @@ public AggregateFunction(FunctionName fnName, List<Type> argTypes,
136159 isAggregateFn = true ;
137160 returnsNonNullOnEmpty = false ;
138161 }
139-
140162 public static AggregateFunction createBuiltin (String name ,
141- List <Type > argTypes , Type retType , Type intermediateType ,
142- String initFnSymbol , String updateFnSymbol , String mergeFnSymbol ,
143- String serializeFnSymbol , String finalizeFnSymbol , boolean ignoresDistinct ,
144- boolean isAnalyticFn , boolean returnsNonNullOnEmpty ) {
163+ List <Type > argTypes , Type retType , Type intermediateType ,
164+ String initFnSymbol , String updateFnSymbol , String mergeFnSymbol ,
165+ String serializeFnSymbol , String finalizeFnSymbol , boolean ignoresDistinct ,
166+ boolean isAnalyticFn , boolean returnsNonNullOnEmpty ) {
167+ return createBuiltin (name , argTypes , retType , intermediateType ,
168+ initFnSymbol , updateFnSymbol , mergeFnSymbol ,
169+ serializeFnSymbol , finalizeFnSymbol , ignoresDistinct , isAnalyticFn , returnsNonNullOnEmpty , false );
170+ }
171+ public static AggregateFunction createBuiltin (String name ,
172+ List <Type > argTypes , Type retType , Type intermediateType ,
173+ String initFnSymbol , String updateFnSymbol , String mergeFnSymbol ,
174+ String serializeFnSymbol , String finalizeFnSymbol , boolean ignoresDistinct ,
175+ boolean isAnalyticFn , boolean returnsNonNullOnEmpty , boolean vectorized ) {
145176 return createBuiltin (name , argTypes , retType , intermediateType , initFnSymbol ,
146- updateFnSymbol , mergeFnSymbol , serializeFnSymbol , null , null , finalizeFnSymbol ,
147- ignoresDistinct , isAnalyticFn , returnsNonNullOnEmpty );
177+ updateFnSymbol , mergeFnSymbol , serializeFnSymbol , null , null , finalizeFnSymbol ,
178+ ignoresDistinct , isAnalyticFn , returnsNonNullOnEmpty , vectorized );
148179 }
149180
150181 public static AggregateFunction createBuiltin (String name ,
151- List <Type > argTypes , Type retType , Type intermediateType ,
152- String initFnSymbol , String updateFnSymbol , String mergeFnSymbol ,
153- String serializeFnSymbol , String getValueFnSymbol , String removeFnSymbol ,
154- String finalizeFnSymbol , boolean ignoresDistinct , boolean isAnalyticFn ,
155- boolean returnsNonNullOnEmpty ) {
182+ List <Type > argTypes , Type retType , Type intermediateType ,
183+ String initFnSymbol , String updateFnSymbol , String mergeFnSymbol ,
184+ String serializeFnSymbol , String getValueFnSymbol , String removeFnSymbol ,
185+ String finalizeFnSymbol , boolean ignoresDistinct , boolean isAnalyticFn ,
186+ boolean returnsNonNullOnEmpty ) {
187+ return createBuiltin (name , argTypes , retType , intermediateType ,
188+ initFnSymbol , updateFnSymbol , mergeFnSymbol ,
189+ serializeFnSymbol , getValueFnSymbol , removeFnSymbol ,
190+ finalizeFnSymbol , ignoresDistinct , isAnalyticFn , returnsNonNullOnEmpty , false );
191+ }
192+
193+ public static AggregateFunction createBuiltin (String name ,
194+ List <Type > argTypes , Type retType , Type intermediateType ,
195+ String initFnSymbol , String updateFnSymbol , String mergeFnSymbol ,
196+ String serializeFnSymbol , String getValueFnSymbol , String removeFnSymbol ,
197+ String finalizeFnSymbol , boolean ignoresDistinct , boolean isAnalyticFn ,
198+ boolean returnsNonNullOnEmpty , boolean vectorized ) {
156199 return createBuiltin (name , argTypes , retType , intermediateType , false ,
157200 initFnSymbol , updateFnSymbol , mergeFnSymbol ,
158201 serializeFnSymbol , getValueFnSymbol , removeFnSymbol ,
159- finalizeFnSymbol , ignoresDistinct , isAnalyticFn ,returnsNonNullOnEmpty );
202+ finalizeFnSymbol , ignoresDistinct , isAnalyticFn , returnsNonNullOnEmpty , vectorized );
160203 }
161204
162205 public static AggregateFunction createBuiltin (String name ,
@@ -165,10 +208,21 @@ public static AggregateFunction createBuiltin(String name,
165208 String serializeFnSymbol , String getValueFnSymbol , String removeFnSymbol ,
166209 String finalizeFnSymbol , boolean ignoresDistinct , boolean isAnalyticFn ,
167210 boolean returnsNonNullOnEmpty ) {
211+ return createBuiltin (name , argTypes , retType , intermediateType , hasVarArgs , initFnSymbol , updateFnSymbol ,
212+ mergeFnSymbol , serializeFnSymbol , getValueFnSymbol , removeFnSymbol , finalizeFnSymbol , ignoresDistinct ,
213+ isAnalyticFn , returnsNonNullOnEmpty , false );
214+ }
215+
216+ public static AggregateFunction createBuiltin (String name ,
217+ List <Type > argTypes , Type retType , Type intermediateType , boolean hasVarArgs ,
218+ String initFnSymbol , String updateFnSymbol , String mergeFnSymbol ,
219+ String serializeFnSymbol , String getValueFnSymbol , String removeFnSymbol ,
220+ String finalizeFnSymbol , boolean ignoresDistinct , boolean isAnalyticFn ,
221+ boolean returnsNonNullOnEmpty , boolean vectorized ) {
168222 AggregateFunction fn = new AggregateFunction (new FunctionName (name ),
169223 argTypes , retType , intermediateType , hasVarArgs , null , updateFnSymbol , initFnSymbol ,
170224 serializeFnSymbol , mergeFnSymbol , getValueFnSymbol , removeFnSymbol ,
171- finalizeFnSymbol );
225+ finalizeFnSymbol , vectorized );
172226 fn .setBinaryType (TFunctionBinaryType .BUILTIN );
173227 fn .ignoresDistinct = ignoresDistinct ;
174228 fn .isAnalyticFn = isAnalyticFn ;
0 commit comments