private AggregationFunctionCallEval createCountRowFunction(EvalNode[] args) throws TajoException { FunctionDesc functionDesc = getCatalog().getFunction("count", CatalogProtos.FunctionType.AGGREGATION, new TajoDataTypes.DataType[]{}); return new AggregationFunctionCallEval(functionDesc, args); }
private AggregationFunctionCallEval createCountRowFunction(EvalNode[] args) throws TajoException { FunctionDesc functionDesc = getCatalog().getFunction("count", CatalogProtos.FunctionType.AGGREGATION, new TajoDataTypes.DataType[]{}); return new AggregationFunctionCallEval(functionDesc, args); }
private AggregationFunctionCallEval createMinFunction(EvalNode [] args) throws TajoException { FunctionDesc functionDesc = getCatalog().getFunction("min", CatalogProtos.FunctionType.AGGREGATION, args[0].getValueType()); return new AggregationFunctionCallEval(functionDesc, args); }
private AggregationFunctionCallEval createSumFunction(EvalNode[] args) throws TajoException { FunctionDesc functionDesc = null; functionDesc = getCatalog().getFunction("sum", CatalogProtos.FunctionType.AGGREGATION, args[0].getValueType()); return new AggregationFunctionCallEval(functionDesc, args); }
private AggregationFunctionCallEval createCountFunction(EvalNode [] args) throws TajoException { FunctionDesc functionDesc = getCatalog().getFunction("count", CatalogProtos.FunctionType.AGGREGATION, args[0].getValueType()); return new AggregationFunctionCallEval(functionDesc, args); }
private AggregationFunctionCallEval createMaxFunction(EvalNode [] args) throws TajoException { FunctionDesc functionDesc = getCatalog().getFunction("max", CatalogProtos.FunctionType.AGGREGATION, args[0].getValueType()); return new AggregationFunctionCallEval(functionDesc, args); }
private AggregationFunctionCallEval createSumFunction(EvalNode[] args) throws TajoException { FunctionDesc functionDesc = null; functionDesc = getCatalog().getFunction("sum", CatalogProtos.FunctionType.AGGREGATION, TypeConverter.convert(args[0].getValueType()).getDataType()); return new AggregationFunctionCallEval(functionDesc, args); }
@Override public EvalNode visitCountRowsFunction(Context ctx, Stack<Expr> stack, CountRowsFunctionExpr expr) throws TajoException { FunctionDesc countRows = catalog.getFunction("count", FunctionType.AGGREGATION, new DataType[] {}); if (countRows == null) { throw new UndefinedFunctionException(buildSimpleFunctionSignature(expr.getSignature(), new DataType[]{})); } ctx.currentBlock.setAggregationRequire(); return new AggregationFunctionCallEval(countRows, new EvalNode[] {}); }
@Override public EvalNode visitCountRowsFunction(Context ctx, Stack<Expr> stack, CountRowsFunctionExpr expr) throws TajoException { FunctionDesc countRows = catalog.getFunction("count", FunctionType.AGGREGATION, new DataType[] {}); if (countRows == null) { throw new UndefinedFunctionException(buildSimpleFunctionSignature(expr.getSignature(), new DataType[]{})); } ctx.currentBlock.setAggregationRequire(); return new AggregationFunctionCallEval(countRows, new EvalNode[] {}); }
private AggregationFunctionCallEval createCountFunction(EvalNode [] args) throws TajoException { FunctionDesc functionDesc = getCatalog().getFunction("count", CatalogProtos.FunctionType.AGGREGATION, TypeConverter.convert(args[0].getValueType()).getDataType()); return new AggregationFunctionCallEval(functionDesc, args); }
private AggregationFunctionCallEval createMaxFunction(EvalNode [] args) throws TajoException { FunctionDesc functionDesc = getCatalog().getFunction("max", CatalogProtos.FunctionType.AGGREGATION, TypeConverter.convert(args[0].getValueType()).getDataType()); return new AggregationFunctionCallEval(functionDesc, args); }
private AggregationFunctionCallEval createMinFunction(EvalNode [] args) throws TajoException { FunctionDesc functionDesc = getCatalog().getFunction("min", CatalogProtos.FunctionType.AGGREGATION, TypeConverter.convert(args[0].getValueType()).getDataType()); return new AggregationFunctionCallEval(functionDesc, args); }
@Override public EvalNode visitGeneralSetFunction(Context ctx, Stack<Expr> stack, GeneralSetFunctionExpr setFunction) throws TajoException { Expr[] params = setFunction.getParams(); EvalNode[] givenArgs = new EvalNode[params.length]; DataType[] paramTypes = new DataType[params.length]; FunctionType functionType = setFunction.isDistinct() ? FunctionType.DISTINCT_AGGREGATION : FunctionType.AGGREGATION; givenArgs[0] = visit(ctx, stack, params[0]); if (setFunction.getSignature().equalsIgnoreCase("count")) { paramTypes[0] = CatalogUtil.newSimpleDataType(Type.ANY); } else { paramTypes[0] = givenArgs[0].getValueType(); } if (!catalog.containFunction(setFunction.getSignature(), functionType, paramTypes)) { throw new UndefinedFunctionException(buildSimpleFunctionSignature(setFunction.getSignature(), paramTypes)); } FunctionDesc funcDesc = catalog.getFunction(setFunction.getSignature(), functionType, paramTypes); if (!ctx.currentBlock.hasNode(NodeType.GROUP_BY)) { ctx.currentBlock.setAggregationRequire(); } return new AggregationFunctionCallEval(funcDesc, givenArgs); }
@Override public EvalNode visitGeneralSetFunction(Context ctx, Stack<Expr> stack, GeneralSetFunctionExpr setFunction) throws TajoException { Expr[] params = setFunction.getParams(); EvalNode[] givenArgs = new EvalNode[params.length]; DataType[] paramTypes = new DataType[params.length]; FunctionType functionType = setFunction.isDistinct() ? FunctionType.DISTINCT_AGGREGATION : FunctionType.AGGREGATION; givenArgs[0] = visit(ctx, stack, params[0]); if (setFunction.getSignature().equalsIgnoreCase("count")) { paramTypes[0] = CatalogUtil.newSimpleDataType(TajoDataTypes.Type.ANY); } else { paramTypes[0] = convert(givenArgs[0].getValueType()).getDataType(); } if (!catalog.containFunction(setFunction.getSignature(), functionType, paramTypes)) { throw new UndefinedFunctionException(buildSimpleFunctionSignature(setFunction.getSignature(), paramTypes)); } FunctionDesc funcDesc = catalog.getFunction(setFunction.getSignature(), functionType, paramTypes); if (!ctx.currentBlock.hasNode(NodeType.GROUP_BY)) { ctx.currentBlock.setAggregationRequire(); } return new AggregationFunctionCallEval(funcDesc, givenArgs); }
ctx.currentBlock.setAggregationRequire(); return new AggregationFunctionCallEval(funcDesc, givenArgs); } else if (functionType == FunctionType.DISTINCT_AGGREGATION || functionType == FunctionType.DISTINCT_UDA) {
ctx.currentBlock.setAggregationRequire(); return new AggregationFunctionCallEval(funcDesc, givenArgs); } else if (functionType == FunctionType.DISTINCT_AGGREGATION || functionType == FunctionType.DISTINCT_UDA) {
if (type == EvalType.AGG_FUNCTION) { AggregationFunctionCallEval aggFunc = new AggregationFunctionCallEval(new FunctionDesc(funcProto.getFuncion()), params);
if (type == EvalType.AGG_FUNCTION) { AggregationFunctionCallEval aggFunc = new AggregationFunctionCallEval(new FunctionDesc(funcProto.getFuncion()), params);