public void markAsEvaluated(Target target) { int refId = nameToIdBiMap.get(target.getCanonicalName()); EvalNode evalNode = target.getEvalTree(); if (!idToNamesMap.containsKey(refId)) { throw new RuntimeException("No such eval: " + evalNode); } evaluationStateMap.put(refId, true); }
public void markAsEvaluated(Target target) { int refId = nameToIdBiMap.get(target.getCanonicalName()); EvalNode evalNode = target.getEvalTree(); if (!idToNamesMap.containsKey(refId)) { throw new RuntimeException("No such eval: " + evalNode); } evaluationStateMap.put(refId, true); }
@Override public int compare(Target o1, Target o2) { return o1.getCanonicalName().compareTo(o2.getCanonicalName()); } });
@Override public int compare(Target o1, Target o2) { return o1.getCanonicalName().compareTo(o2.getCanonicalName()); } });
@Override public int compare(Target o1, Target o2) { return o1.getCanonicalName().compareTo(o2.getCanonicalName()); } });
@Override public int compare(Target o1, Target o2) { return o1.getCanonicalName().compareTo(o2.getCanonicalName()); } });
FilteredIterator(List<Target> targets, Set<String> requiredReferences) { List<Target> filtered = new ArrayList<>(); Map<String, Target> targetSet = new HashMap<>(); for (Target t : targets) { // Only should keep an raw target instead of field reference. if (targetSet.containsKey(t.getCanonicalName())) { Target targetInSet = targetSet.get(t.getCanonicalName()); EvalNode evalNode = targetInSet.getEvalTree(); if (evalNode.getType() == EvalType.FIELD && t.getEvalTree().getType() != EvalType.FIELD) { targetSet.put(t.getCanonicalName(), t); } } else { targetSet.put(t.getCanonicalName(), t); } } for (String name : requiredReferences) { if (targetSet.containsKey(name)) { filtered.add(targetSet.get(name)); } } iterator = filtered.iterator(); } @Override
FilteredIterator(Target [] targets, Set<String> requiredReferences) { List<Target> filtered = TUtil.newList(); Map<String, Target> targetSet = new HashMap<String, Target>(); for (Target t : targets) { // Only should keep an raw target instead of field reference. if (targetSet.containsKey(t.getCanonicalName())) { Target targetInSet = targetSet.get(t.getCanonicalName()); EvalNode evalNode = targetInSet.getEvalTree(); if (evalNode.getType() == EvalType.FIELD && t.getEvalTree().getType() != EvalType.FIELD) { targetSet.put(t.getCanonicalName(), t); } } else { targetSet.put(t.getCanonicalName(), t); } } for (String name : requiredReferences) { if (targetSet.containsKey(name)) { filtered.add(targetSet.get(name)); } } iterator = filtered.iterator(); } @Override
public String add(Target target) throws DuplicateColumnException { return add(target.getCanonicalName(), target.getEvalTree()); }
public String add(Target target) throws DuplicateColumnException { return add(target.getCanonicalName(), target.getEvalTree()); }
nodeTargetMap.put(target.getCanonicalName(), target);
nodeTargetMap.put(target.getCanonicalName(), target);
Target target = node.getTargets().get(targetIdx); EvalNode evalNode = node.getAggFunctions().get(evalIdx); aggEvalNames[evalIdx] = newContext.addExpr(new Target(evalNode, target.getCanonicalName()));
assertEquals("default.self_desc_table1.dept", targets.get(0).getCanonicalName()); assertEquals("default.self_desc_table1.id", targets.get(1).getCanonicalName()); assertEquals("default.self_desc_table1.name", targets.get(2).getCanonicalName()); assertEquals("default.self_desc_table1.dept", targets.get(0).getCanonicalName()); assertEquals("default.self_desc_table1.id", targets.get(1).getCanonicalName()); assertEquals("default.self_desc_table1.name", targets.get(2).getCanonicalName());
Target target = node.getTargets().get(targetIdx); WindowFunctionEval winFunc = node.getWindowFunctions()[evalIdx]; aggEvalNames[evalIdx] = newContext.addExpr(new Target(winFunc, target.getCanonicalName()));
Target target = node.getTargets()[targetIdx]; EvalNode evalNode = node.getAggFunctions()[evalIdx]; aggEvalNames[evalIdx] = newContext.addExpr(new Target(evalNode, target.getCanonicalName()));
nonFunctionColumns = new int[nonFunctionColumnNum]; for (int idx = 0; idx < plan.getTargets().size() - functionNum; idx++) { nonFunctionColumns[idx] = inSchema.getColumnId(plan.getTargets().get(idx).getCanonicalName());
Target target = node.getTargets()[targetIdx]; WindowFunctionEval winFunc = node.getWindowFunctions()[evalIdx]; aggEvalNames[evalIdx] = newContext.addExpr(new Target(winFunc, target.getCanonicalName()));
nonFunctionColumns = new int[nonFunctionColumnNum]; for (int idx = 0; idx < plan.getTargets().length - functionNum; idx++) { nonFunctionColumns[idx] = inSchema.getColumnId(plan.getTargets()[idx].getCanonicalName());
assertEquals("default.self_desc_table1.dept", targets.get(0).getCanonicalName()); assertEquals("default.self_desc_table1.name", targets.get(1).getCanonicalName()); assertEquals("?greaterthan", targets.get(0).getCanonicalName()); assertEquals("default.self_desc_table1.dept", targets.get(1).getCanonicalName()); assertEquals("default.self_desc_table1.id", targets.get(2).getCanonicalName()); assertEquals("default.self_desc_table1.name", targets.get(3).getCanonicalName());