@Override public String getName() { return type.name(); }
public String getOperatorName() { return operatorName != null ? operatorName : name(); }
@Override public String getName() { return type.name(); }
public String getOperatorName() { return operatorName != null ? operatorName : name(); }
@Override public JsonElement serialize(EvalNode evalNode, Type type, JsonSerializationContext ctx) { JsonObject json = new JsonObject(); json.addProperty("type", evalNode.getType().name()); json.add("body", ctx.serialize(evalNode)); return json; } }
@Override public JsonElement serialize(EvalNode evalNode, Type type, JsonSerializationContext ctx) { JsonObject json = new JsonObject(); json.addProperty("type", evalNode.getType().name()); json.add("body", ctx.serialize(evalNode)); return json; } }
private PlanProto.EvalNode.Builder createEvalBuilder(EvalTreeProtoBuilderContext context, EvalNode node) { int sid; // serialization sequence id if (context.idMap.containsKey(node)) { sid = context.idMap.get(node); } else { sid = context.seqId++; context.idMap.put(node, sid); } PlanProto.EvalNode.Builder nodeBuilder = PlanProto.EvalNode.newBuilder(); nodeBuilder.setId(sid); nodeBuilder.setDataType(node.getValueType().getProto()); nodeBuilder.setType(PlanProto.EvalType.valueOf(node.getType().name())); return nodeBuilder; }
private PlanProto.EvalNode.Builder createEvalBuilder(EvalTreeProtoBuilderContext context, EvalNode node) { int sid; // serialization sequence id if (context.idMap.containsKey(node)) { sid = context.idMap.get(node); } else { sid = context.seqId++; context.idMap.put(node, sid); } PlanProto.EvalNode.Builder nodeBuilder = PlanProto.EvalNode.newBuilder(); nodeBuilder.setId(sid); nodeBuilder.setDataType(node.getValueType()); nodeBuilder.setType(PlanProto.EvalType.valueOf(node.getType().name())); return nodeBuilder; }
public EvalNode visitBinaryEval(EvalCodeGenContext context, Stack<EvalNode> stack, BinaryEval binaryEval) { super.visitBinaryEval(context, stack, binaryEval); if (EvalType.isStringPatternMatchOperator(binaryEval.getType())) { if (!context.symbols.containsKey(binaryEval)) { String fieldName = binaryEval.getType().name() + "_" + context.seqId++; context.symbols.put(binaryEval, fieldName); Class clazz = EvalCodeGenerator.getStringPatternEvalClass(binaryEval.getType()); context.classWriter.visitField(Opcodes.ACC_PRIVATE, fieldName, "L" + TajoGeneratorAdapter.getInternalName(clazz) + ";", null, null); } } else if (binaryEval.getType() == EvalType.IN) { if (!context.symbols.containsKey(binaryEval)) { String fieldName = binaryEval.getType().name() + "_" + context.seqId++; context.symbols.put(binaryEval, fieldName); context.classWriter.visitField(Opcodes.ACC_PRIVATE, fieldName, "L" + TajoGeneratorAdapter.getInternalName(InEval.class) + ";", null, null); } } return binaryEval; }
public EvalNode visitBinaryEval(EvalCodeGenContext context, Stack<EvalNode> stack, BinaryEval binaryEval) { super.visitBinaryEval(context, stack, binaryEval); if (EvalType.isStringPatternMatchOperator(binaryEval.getType())) { if (!context.symbols.containsKey(binaryEval)) { String fieldName = binaryEval.getType().name() + "_" + context.seqId++; context.symbols.put(binaryEval, fieldName); Class clazz = EvalCodeGenerator.getStringPatternEvalClass(binaryEval.getType()); context.classWriter.visitField(Opcodes.ACC_PRIVATE, fieldName, "L" + TajoGeneratorAdapter.getInternalName(clazz) + ";", null, null); } } else if (binaryEval.getType() == EvalType.IN) { if (!context.symbols.containsKey(binaryEval)) { String fieldName = binaryEval.getType().name() + "_" + context.seqId++; context.symbols.put(binaryEval, fieldName); context.classWriter.visitField(Opcodes.ACC_PRIVATE, fieldName, "L" + TajoGeneratorAdapter.getInternalName(InEval.class) + ";", null, null); } } return binaryEval; }
case CONCATENATE: default: throw new RuntimeException("Unsupported type: " + binaryEval.getType().name());