本文整理匯總了Java中org.apache.tajo.engine.function.GeneralFunction類的典型用法代碼示例。如果您正苦於以下問題:Java GeneralFunction類的具體用法?Java GeneralFunction怎麽用?Java GeneralFunction使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
GeneralFunction類屬於org.apache.tajo.engine.function包,在下文中一共展示了GeneralFunction類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: registerAdapters
import org.apache.tajo.engine.function.GeneralFunction; //導入依賴的package包/類
private static Map<Type, GsonSerDerAdapter> registerAdapters() {
Map<Type, GsonSerDerAdapter> adapters = TUtil.newHashMap();
adapters.put(Path.class, new PathSerializer());
adapters.put(Class.class, new ClassNameSerializer());
adapters.put(LogicalNode.class, new LogicalNodeAdapter());
adapters.put(EvalNode.class, new EvalNodeAdapter());
adapters.put(TableMeta.class, new TableMetaAdapter());
adapters.put(Function.class, new FunctionAdapter());
adapters.put(GeneralFunction.class, new FunctionAdapter());
adapters.put(AggFunction.class, new FunctionAdapter());
adapters.put(Datum.class, new DatumAdapter());
adapters.put(DataType.class, new DataTypeAdapter());
return adapters;
}
示例2: visitFunction
import org.apache.tajo.engine.function.GeneralFunction; //導入依賴的package包/類
@Override
public EvalNode visitFunction(Context ctx, Stack<Expr> stack, FunctionExpr expr) throws PlanningException {
stack.push(expr); // <--- Push
// Given parameters
Expr[] params = expr.getParams();
if (params == null) {
params = new Expr[0];
}
EvalNode[] givenArgs = new EvalNode[params.length];
TajoDataTypes.DataType[] paramTypes = new TajoDataTypes.DataType[params.length];
for (int i = 0; i < params.length; i++) {
givenArgs[i] = visit(ctx, stack, params[i]);
paramTypes[i] = givenArgs[i].getValueType();
}
stack.pop(); // <--- Pop
if (!catalog.containFunction(expr.getSignature(), paramTypes)) {
throw new NoSuchFunctionException(expr.getSignature(), paramTypes);
}
FunctionDesc funcDesc = catalog.getFunction(expr.getSignature(), paramTypes);
try {
CatalogProtos.FunctionType functionType = funcDesc.getFuncType();
if (functionType == CatalogProtos.FunctionType.GENERAL
|| functionType == CatalogProtos.FunctionType.UDF) {
return new GeneralFunctionEval(funcDesc, (GeneralFunction) funcDesc.newInstance(), givenArgs);
} else if (functionType == CatalogProtos.FunctionType.AGGREGATION
|| functionType == CatalogProtos.FunctionType.UDA) {
if (!ctx.currentBlock.hasNode(NodeType.GROUP_BY)) {
ctx.currentBlock.setAggregationRequire();
}
return new AggregationFunctionCallEval(funcDesc, (AggFunction) funcDesc.newInstance(), givenArgs);
} else if (functionType == CatalogProtos.FunctionType.DISTINCT_AGGREGATION
|| functionType == CatalogProtos.FunctionType.DISTINCT_UDA) {
throw new PlanningException("Unsupported function: " + funcDesc.toString());
} else {
throw new PlanningException("Unsupported Function Type: " + functionType.name());
}
} catch (InternalException e) {
throw new PlanningException(e);
}
}
示例3: GeneralFunctionEval
import org.apache.tajo.engine.function.GeneralFunction; //導入依賴的package包/類
public GeneralFunctionEval(FunctionDesc desc, GeneralFunction instance, EvalNode[] givenArgs) {
super(EvalType.FUNCTION, desc, givenArgs);
this.instance = instance;
this.instance.init(getParamType());
}
示例4: clone
import org.apache.tajo.engine.function.GeneralFunction; //導入依賴的package包/類
@Override
public Object clone() throws CloneNotSupportedException {
GeneralFunctionEval eval = (GeneralFunctionEval) super.clone();
eval.instance = (GeneralFunction) instance.clone();
return eval;
}