public EvalNode visitCast(EvalCodeGenContext context, Stack<EvalNode> stack, CastEval cast) {
org.apache.tajo.type.Type srcType = cast.getOperand().getValueType();
org.apache.tajo.type.Type targetType = cast.getValueType();
if (srcType.equals(targetType)) {
visit(context, cast.getChild(), stack);
return cast;
}
visit(context, cast.getChild(), stack);
Label ifNull = new Label();
Label afterEnd = new Label();
context.emitNullityCheck(ifNull);
context.castInsn(srcType, targetType);
context.pushNullFlag(true);
emitGotoLabel(context, afterEnd);
emitLabel(context, ifNull);
context.pop(srcType);
context.pushDummyValue(targetType);
context.pushNullFlag(false);
emitLabel(context, afterEnd);
return cast;
}