@Override public boolean equals(Object obj) { if (obj instanceof IsNullEval) { IsNullEval other = (IsNullEval) obj; return super.equals(other) && isNot == other.isNot(); } else { return false; } }
@Override public EvalNode visitIsNullPredicate(Context ctx, Stack<Expr> stack, IsNullPredicate expr) throws TajoException { stack.push(expr); EvalNode child = visit(ctx, stack, expr.getPredicand()); stack.pop(); return new IsNullEval(expr.isNot(), child); }
public EvalNode visitIsNull(EvalCodeGenContext context, IsNullEval isNullEval, Stack<EvalNode> stack) { visit(context, isNullEval.getChild(), stack); Label ifNull = new Label(); Label endIf = new Label(); context.emitNullityCheck(ifNull); context.pop(isNullEval.getChild().getValueType()); context.pushBooleanOfThreeValuedLogic(isNullEval.isNot() ? true : false); context.methodvisitor.visitJumpInsn(Opcodes.GOTO, endIf); context.methodvisitor.visitLabel(ifNull); context.pop(isNullEval.getChild().getValueType()); context.pushBooleanOfThreeValuedLogic(isNullEval.isNot() ? false : true); emitLabel(context, endIf); context.methodvisitor.visitInsn(Opcodes.ICONST_1); // NOT NULL return isNullEval; }
@Override public boolean equals(Object obj) { if (obj instanceof IsNullEval) { IsNullEval other = (IsNullEval) obj; return super.equals(other) && isNot == other.isNot(); } else { return false; } }
public EvalNode visitIsNull(EvalCodeGenContext context, IsNullEval isNullEval, Stack<EvalNode> stack) { visit(context, isNullEval.getChild(), stack); Label ifNull = new Label(); Label endIf = new Label(); context.emitNullityCheck(ifNull); context.pop(isNullEval.getChild().getValueType()); context.pushBooleanOfThreeValuedLogic(isNullEval.isNot() ? true : false); context.methodvisitor.visitJumpInsn(Opcodes.GOTO, endIf); context.methodvisitor.visitLabel(ifNull); context.pop(isNullEval.getChild().getValueType()); context.pushBooleanOfThreeValuedLogic(isNullEval.isNot() ? false : true); emitLabel(context, endIf); context.methodvisitor.visitInsn(Opcodes.ICONST_1); // NOT NULL return isNullEval; }
@Override public EvalNode visitIsNullPredicate(Context ctx, Stack<Expr> stack, IsNullPredicate expr) throws TajoException { stack.push(expr); EvalNode child = visit(ctx, stack, expr.getPredicand()); stack.pop(); return new IsNullEval(expr.isNot(), child); }
@Override protected EvalNode visitUnaryEval(Context context, UnaryEval unary, Stack<EvalNode> stack) { switch (unary.getType()) { case NOT: context.sb.append("NOT "); super.visitUnaryEval(context, unary, stack); break; case SIGNED: SignedEval signed = (SignedEval) unary; if (signed.isNegative()) { context.sb.append("-"); } super.visitUnaryEval(context, unary, stack); break; case IS_NULL: super.visitUnaryEval(context, unary, stack); IsNullEval isNull = (IsNullEval) unary; if (isNull.isNot()) { context.sb.append("IS NOT NULL "); } else { context.sb.append("IS NULL "); } break; case CAST: super.visitUnaryEval(context, unary, stack); context.sb.append(" AS ").append(convertTajoTypeToSQLType(unary.getValueType())); } return unary; }
accumulatedFilters.add(new IsNullEval(true, new FieldEval(target)));
@Override protected EvalNode visitUnaryEval(Context context, UnaryEval unary, Stack<EvalNode> stack) { switch (unary.getType()) { case NOT: context.sb.append("NOT "); super.visitUnaryEval(context, unary, stack); break; case SIGNED: SignedEval signed = (SignedEval) unary; if (signed.isNegative()) { context.sb.append("-"); } super.visitUnaryEval(context, unary, stack); break; case IS_NULL: super.visitUnaryEval(context, unary, stack); IsNullEval isNull = (IsNullEval) unary; if (isNull.isNot()) { context.sb.append("IS NOT NULL "); } else { context.sb.append("IS NULL "); } break; case CAST: super.visitUnaryEval(context, unary, stack); context.sb.append(" AS ").append(convertTajoTypeToSQLType(unary.getValueType())); } return unary; }
accumulatedFilters.add(new IsNullEval(true, new FieldEval(target)));
@Override public EvalNode visitUnaryEval(EvalTreeProtoBuilderContext context, UnaryEval unary, Stack<EvalNode> stack) { // visiting and registering childs super.visitUnaryEval(context, unary, stack); int [] childIds = registerGetChildIds(context, unary); // building itself PlanProto.UnaryEval.Builder unaryBuilder = PlanProto.UnaryEval.newBuilder(); unaryBuilder.setChildId(childIds[0]); if (unary.getType() == EvalType.IS_NULL) { IsNullEval isNullEval = (IsNullEval) unary; unaryBuilder.setNegative(isNullEval.isNot()); } else if (unary.getType() == EvalType.SIGNED) { SignedEval signedEval = (SignedEval) unary; unaryBuilder.setNegative(signedEval.isNegative()); } else if (unary.getType() == EvalType.CAST) { CastEval castEval = (CastEval) unary; unaryBuilder.setCastingType(castEval.getValueType()); } // registering itself and building EvalNode PlanProto.EvalNode.Builder builder = createEvalBuilder(context, unary); builder.setUnary(unaryBuilder); context.treeBuilder.addNodes(builder); return unary; }
break; case IS_NULL: current = new IsNullEval(unaryProto.getNegative(), child); break; case CAST:
@Override public EvalNode visitUnaryEval(EvalTreeProtoBuilderContext context, UnaryEval unary, Stack<EvalNode> stack) { // visiting and registering childs super.visitUnaryEval(context, unary, stack); int [] childIds = registerGetChildIds(context, unary); // building itself PlanProto.UnaryEval.Builder unaryBuilder = PlanProto.UnaryEval.newBuilder(); unaryBuilder.setChildId(childIds[0]); if (unary.getType() == EvalType.IS_NULL) { IsNullEval isNullEval = (IsNullEval) unary; unaryBuilder.setNegative(isNullEval.isNot()); } else if (unary.getType() == EvalType.SIGNED) { SignedEval signedEval = (SignedEval) unary; unaryBuilder.setNegative(signedEval.isNegative()); } else if (unary.getType() == EvalType.CAST) { CastEval castEval = (CastEval) unary; unaryBuilder.setCastingType(castEval.getValueType().getProto()); } // registering itself and building EvalNode PlanProto.EvalNode.Builder builder = createEvalBuilder(context, unary); builder.setUnary(unaryBuilder); context.treeBuilder.addNodes(builder); return unary; }
break; case IS_NULL: current = new IsNullEval(unaryProto.getNegative(), child); break; case CAST: