15 package com.cloudera.impala.catalog;
17 import java.util.ArrayList;
18 import java.util.List;
22 import com.cloudera.impala.thrift.TAggregateFunction;
23 import com.cloudera.impala.thrift.TFunction;
24 import com.cloudera.impala.thrift.TFunctionBinaryType;
71 super(fnName, argTypes, retType, hasVarArgs);
76 HdfsUri location, String updateFnSymbol, String initFnSymbol,
77 String serializeFnSymbol, String mergeFnSymbol, String getValueFnSymbol,
78 String removeFnSymbol, String finalizeFnSymbol) {
79 super(fnName, argTypes, retType,
false);
96 List<Type> argTypes,
Type retType,
Type intermediateType,
97 String initFnSymbol, String updateFnSymbol, String mergeFnSymbol,
98 String serializeFnSymbol, String finalizeFnSymbol,
boolean ignoresDistinct,
100 return createBuiltin(db, name, argTypes, retType, intermediateType, initFnSymbol,
101 updateFnSymbol, mergeFnSymbol, serializeFnSymbol, null, null, finalizeFnSymbol,
102 ignoresDistinct, isAnalyticFn, returnsNonNullOnEmpty);
106 List<Type> argTypes,
Type retType,
Type intermediateType,
107 String initFnSymbol, String updateFnSymbol, String mergeFnSymbol,
108 String serializeFnSymbol, String getValueFnSymbol, String removeFnSymbol,
112 argTypes, retType, intermediateType, null, updateFnSymbol, initFnSymbol,
113 serializeFnSymbol, mergeFnSymbol, getValueFnSymbol, removeFnSymbol,
115 fn.setBinaryType(TFunctionBinaryType.BUILTIN);
118 fn.isAggregateFn_ =
true;
124 List<Type> argTypes,
Type retType,
Type intermediateType) {
126 null, null, null, null,
true);
130 List<Type> argTypes,
Type retType,
Type intermediateType,
131 String initFnSymbol, String updateFnSymbol, String removeFnSymbol,
132 String getValueFnSymbol, String finalizeFnSymbol) {
134 initFnSymbol, updateFnSymbol, removeFnSymbol, getValueFnSymbol, finalizeFnSymbol,
139 List<Type> argTypes,
Type retType,
Type intermediateType,
140 String initFnSymbol, String updateFnSymbol, String removeFnSymbol,
141 String getValueFnSymbol, String finalizeFnSymbol,
boolean isUserVisible) {
143 argTypes, retType, intermediateType, null, updateFnSymbol, initFnSymbol,
144 null, null, getValueFnSymbol, removeFnSymbol, finalizeFnSymbol);
145 fn.setBinaryType(TFunctionBinaryType.BUILTIN);
146 fn.ignoresDistinct_ =
false;
147 fn.isAnalyticFn_ =
true;
148 fn.isAggregateFn_ =
false;
149 fn.returnsNonNullOnEmpty_ =
false;
150 fn.setUserVisible(isUserVisible);
182 TFunction fn = super.toThrift();
183 TAggregateFunction agg_fn =
new TAggregateFunction();
192 agg_fn.setIntermediate_type(intermediateType_.toThrift());
197 fn.setAggregate_fn(agg_fn);
boolean ignoresDistinct()
AggregateFunction(FunctionName fnName, List< Type > argTypes, Type retType, Type intermediateType, HdfsUri location, String updateFnSymbol, String initFnSymbol, String serializeFnSymbol, String mergeFnSymbol, String getValueFnSymbol, String removeFnSymbol, String finalizeFnSymbol)
void setRemoveFnSymbol(String fn)
void setLocation(HdfsUri loc)
void setMergeFnSymbol(String fn)
static AggregateFunction createAnalyticBuiltin(Db db, String name, List< Type > argTypes, Type retType, Type intermediateType)
String getSerializeFnSymbol()
void setInitFnSymbol(String fn)
static AggregateFunction createBuiltin(Db db, String name, List< Type > argTypes, Type retType, Type intermediateType, String initFnSymbol, String updateFnSymbol, String mergeFnSymbol, String serializeFnSymbol, String finalizeFnSymbol, boolean ignoresDistinct, boolean isAnalyticFn, boolean returnsNonNullOnEmpty)
void setGetValueFnSymbol(String fn)
void setFinalizeFnSymbol(String fn)
void setIntermediateType(Type t)
String getGetValueFnSymbol()
String getMergeFnSymbol()
static String BE_BUILTINS_CLASS
boolean returnsNonNullOnEmpty()
String serializeFnSymbol_
void setUpdateFnSymbol(String fn)
Type getIntermediateType()
String getUpdateFnSymbol()
String getFinalizeFnSymbol()
static AggregateFunction createAnalyticBuiltin(Db db, String name, List< Type > argTypes, Type retType, Type intermediateType, String initFnSymbol, String updateFnSymbol, String removeFnSymbol, String getValueFnSymbol, String finalizeFnSymbol, boolean isUserVisible)
AggregateFunction(FunctionName fnName, ArrayList< Type > argTypes, Type retType, boolean hasVarArgs)
String getRemoveFnSymbol()
static AggregateFunction createAnalyticBuiltin(Db db, String name, List< Type > argTypes, Type retType, Type intermediateType, String initFnSymbol, String updateFnSymbol, String removeFnSymbol, String getValueFnSymbol, String finalizeFnSymbol)
static AggregateFunction createBuiltin(Db db, String name, List< Type > argTypes, Type retType, Type intermediateType, String initFnSymbol, String updateFnSymbol, String mergeFnSymbol, String serializeFnSymbol, String getValueFnSymbol, String removeFnSymbol, String finalizeFnSymbol, boolean ignoresDistinct, boolean isAnalyticFn, boolean returnsNonNullOnEmpty)
void setSerializeFnSymbol(String fn)
boolean returnsNonNullOnEmpty_