public final void setAlias(String alias) { this.alias = alias; this.column = new Column(alias, expr.getValueType()); }
@Override public org.apache.tajo.type.Type getValueType() { // Find not null type for (IfThenEval eachWhen: whens) { if (!eachWhen.getResult().getValueType().isNull()) { return eachWhen.getResult().getValueType(); } } if (elseResult != null) { // without else clause return elseResult.getValueType(); } return org.apache.tajo.type.Type.Null; }
public final void setAlias(String alias) { this.alias = alias; this.column = new Column(alias, expr.getValueType()); }
public EvalNode visitInPredicate(EvalCodeGenContext context, EvalNode patternEval, Stack<EvalNode> stack) { String fieldName = context.symbols.get(patternEval); emitGetField(context, context.owner, fieldName, InEval.class); context.aload(1); // tuple context.invokeVirtual(InEval.class, "eval", Datum.class, new Class[]{Tuple.class}); context.convertToPrimitive(patternEval.getValueType()); return patternEval; }
public Target(final EvalNode eval, final String alias) { this.expr = eval; // force lower case String normalized = alias; // If an expr is a column reference and its alias is equivalent to column name, ignore a given alias. if (eval instanceof FieldEval && eval.getName().equals(normalized)) { column = ((FieldEval) eval).getColumnRef(); } else { column = new Column(normalized, eval.getValueType()); setAlias(alias); } }
private AggregationFunctionCallEval createMinFunction(EvalNode [] args) throws TajoException { FunctionDesc functionDesc = getCatalog().getFunction("min", CatalogProtos.FunctionType.AGGREGATION, args[0].getValueType()); return new AggregationFunctionCallEval(functionDesc, args); }
public EvalNode visitInPredicate(EvalCodeGenContext context, EvalNode patternEval, Stack<EvalNode> stack) { String fieldName = context.symbols.get(patternEval); emitGetField(context, context.owner, fieldName, InEval.class); context.aload(1); // tuple context.invokeVirtual(InEval.class, "eval", Datum.class, new Class[]{Tuple.class}); context.convertToPrimitive(patternEval.getValueType()); return patternEval; }
/** * It checks both expressions in a comparison operator are compatible to each other. */ private static void verifyComparisonOperator(VerificationState state, BinaryEval expr) { if (!isCompatibleType(expr.getLeftExpr().getValueType(), expr.getRightExpr().getValueType())) { state.addVerification(new UndefinedOperatorException(expr.toString())); } }
public Target(final EvalNode eval, final String alias) { this.expr = eval; // force lower case String normalized = alias; // If an expr is a column reference and its alias is equivalent to column name, ignore a given alias. if (eval instanceof FieldEval && eval.getName().equals(normalized)) { column = ((FieldEval) eval).getColumnRef(); } else { column = new Column(normalized, eval.getValueType()); setAlias(alias); } }
/** * It checks both expressions in a comparison operator are compatible to each other. */ private static void verifyComparisonOperator(VerificationState state, BinaryEval expr) { DataType leftType = expr.getLeftExpr().getValueType(); DataType rightType = expr.getRightExpr().getValueType(); if (!isCompatibleType(leftType, rightType)) { state.addVerification(new UndefinedOperatorException(expr.toString())); } }
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); }
public static void prohibitNestedRecordProjection(Projectable projectable) throws TajoException { for (Target t : projectable.getTargets()) { if (t.getEvalTree().getValueType().getType() == TajoDataTypes.Type.RECORD) { throw new NotImplementedException("record field projection"); } } }
public static void prohibitNestedRecordProjection(Projectable projectable) throws TajoException { for (Target t : projectable.getTargets()) { if (t.getEvalTree().getValueType().isStruct()) { throw new NotImplementedException("record field projection"); } } }
protected EvalNode visitStringPatternMatch(EvalCodeGenContext context, EvalNode patternEval, Stack<EvalNode> stack) { Class clazz = getStringPatternEvalClass(patternEval.getType()); String fieldName = context.symbols.get(patternEval); emitGetField(context, context.owner, fieldName, clazz); context.aload(1); // tuple context.invokeVirtual(clazz, "eval", Datum.class, new Class[]{Tuple.class}); context.convertToPrimitive(patternEval.getValueType()); return patternEval; }
protected EvalNode visitStringPatternMatch(EvalCodeGenContext context, EvalNode patternEval, Stack<EvalNode> stack) { Class clazz = getStringPatternEvalClass(patternEval.getType()); String fieldName = context.symbols.get(patternEval); emitGetField(context, context.owner, fieldName, clazz); context.aload(1); // tuple context.invokeVirtual(clazz, "eval", Datum.class, new Class[]{Tuple.class}); context.convertToPrimitive(patternEval.getValueType()); return patternEval; }
public void emitReturn() { convertToDatum(evalNode.getValueType(), true); methodvisitor.visitInsn(Opcodes.ARETURN); methodvisitor.visitMaxs(0, 0); methodvisitor.visitEnd(); classWriter.visitEnd(); } }
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); }
public void emitReturn() { convertToDatum(evalNode.getValueType(), true); methodvisitor.visitInsn(Opcodes.ARETURN); methodvisitor.visitMaxs(0, 0); methodvisitor.visitEnd(); classWriter.visitEnd(); } }