@Test public final void testChangeColumnRef() throws CloneNotSupportedException { EvalNode copy = (EvalNode)expr1.clone(); EvalTreeUtil.changeColumnRef(copy, "people.score", "newscore"); Set<Column> set = EvalTreeUtil.findUniqueColumns(copy); assertEquals(1, set.size()); assertTrue(set.contains(new Column("newscore", TajoDataTypes.Type.INT4))); copy = (EvalNode)expr2.clone(); EvalTreeUtil.changeColumnRef(copy, "people.age", "sum_age"); set = EvalTreeUtil.findUniqueColumns(copy); assertEquals(2, set.size()); assertTrue(set.contains(new Column("people.score", TajoDataTypes.Type.INT4))); assertTrue(set.contains(new Column("sum_age", TajoDataTypes.Type.INT4))); copy = (EvalNode)expr3.clone(); EvalTreeUtil.changeColumnRef(copy, "people.age", "sum_age"); set = EvalTreeUtil.findUniqueColumns(copy); assertEquals(2, set.size()); assertTrue(set.contains(new Column("people.score", TajoDataTypes.Type.INT4))); assertTrue(set.contains(new Column("sum_age", TajoDataTypes.Type.INT4))); }
public static void changeColumnRef(EvalNode node, String oldName, String newName) { node.postOrder(new ChangeColumnRefVisitor(oldName, newName)); }
EvalTreeUtil { public static void changeColumnRef(EvalNode node, String oldName, String newName) { node.postOrder(new ChangeColumnRefVisitor(oldName, newName)); } }
EvalTreeUtil { public static void changeColumnRef(EvalNode node, String oldName, String newName) { node.postOrder(new ChangeColumnRefVisitor(oldName, newName)); }  }
EvalTreeUtil { public static void changeColumnRef(EvalNode node, String oldName, String newName) { node.postOrder(new ChangeColumnRefVisitor(oldName, newName)); }  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 void changeColumnRef(EvalNode node, String oldName, String newName) { node.postOrder(new ChangeColumnRefVisitor(oldName, newName)); }  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);  }