@Test public final void testGetContainExprs() throws CloneNotSupportedException, PlanningException { Expr expr = analyzer.parse(QUERIES[1]); LogicalPlan plan = planner.createPlan(expr, true); Target [] targets = plan.getRootBlock().getRawTargets(); Column col1 = new Column("people.score", TajoDataTypes.Type.INT4); Collection<EvalNode> exprs = EvalTreeUtil.getContainExpr(targets[0].getEvalTree(), col1); EvalNode node = exprs.iterator().next(); assertEquals(EvalType.LTH, node.getType()); assertEquals(EvalType.PLUS, node.getLeftExpr().getType()); assertEquals(new ConstEval(DatumFactory.createInt4(4)), node.getRightExpr()); Column col2 = new Column("people.age", TajoDataTypes.Type.INT4); exprs = EvalTreeUtil.getContainExpr(targets[1].getEvalTree(), col2); node = exprs.iterator().next(); assertEquals(EvalType.GTH, node.getType()); assertEquals("people.age", node.getLeftExpr().getName()); assertEquals(new ConstEval(DatumFactory.createInt4(5)), node.getRightExpr()); }
public static Collection<EvalNode> getContainExpr(EvalNode expr, Column target) { Set<EvalNode> exprSet = Sets.newHashSet(); getContainExpr(expr, target, exprSet); return exprSet; }
EvalTreeUtil { public static Collection<EvalNode> getContainExpr(EvalNode expr, Column target) { Set<EvalNode> exprSet = Sets.newHashSet(); getContainExpr(expr, target, exprSet); return exprSet; } }
EvalTreeUtil { public static Collection<EvalNode> getContainExpr(EvalNode expr, Column target) { Set<EvalNode> exprSet = Sets.newHashSet(); getContainExpr(expr, target, exprSet); return exprSet; }  }
EvalTreeUtil { public static Collection<EvalNode> getContainExpr(EvalNode expr, Column target) { Set<EvalNode> exprSet = Sets.newHashSet(); getContainExpr(expr, target, exprSet); return exprSet; }  static void changeColumnRef(EvalNode node, String oldName, String newName); static void replace(EvalNode expr, EvalNode targetExpr, EvalNode tobeReplaced); static LinkedHashSet<Column> findUniqueColumns(EvalNode node); static List<Column> findAllColumnRefs(EvalNode node); static Schema getSchemaByTargets(Schema inputSchema, Target [] targets); static DataType getDomainByExpr(Schema inputSchema, EvalNode expr); static Collection<EvalNode> getContainExpr(EvalNode expr, Column target); static Map<EvalType, Integer> getExprCounters(EvalNode expr); static boolean containColumnRef(EvalNode expr, Column target); static boolean isJoinQual(EvalNode expr); static Set<AggregationFunctionCallEval> findDistinctAggFunction(EvalNode expr); static Collection<T> findEvalsByType(EvalNode evalNode, EvalType type); }
EvalTreeUtil { public static Collection<EvalNode> getContainExpr(EvalNode expr, Column target) { Set<EvalNode> exprSet = Sets.newHashSet(); getContainExpr(expr, target, exprSet); return exprSet; }  static void changeColumnRef(EvalNode node, String oldName, String newName); static void replace(EvalNode expr, EvalNode targetExpr, EvalNode tobeReplaced); static LinkedHashSet<Column> findUniqueColumns(EvalNode node); static List<Column> findAllColumnRefs(EvalNode node); static Schema getSchemaByTargets(Schema inputSchema, Target [] targets); static DataType getDomainByExpr(Schema inputSchema, EvalNode expr); static Collection<EvalNode> getContainExpr(EvalNode expr, Column target); static Map<EvalType, Integer> getExprCounters(EvalNode expr); static boolean containColumnRef(EvalNode expr, Column target); static boolean isJoinQual(EvalNode expr); static Set<AggregationFunctionCallEval> findDistinctAggFunction(EvalNode expr); static Collection<T> findEvalsByType(EvalNode evalNode, EvalType type);  }