@Override public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx, Object... nodeOutputs) throws SemanticException { assert (nd instanceof ExprNodeConstantDesc); // Create a dependency that has no basecols Dependency dep = new Dependency(); dep.setType(LineageInfo.DependencyType.SIMPLE); dep.setBaseCols(new LinkedHashSet<BaseColumnInfo>()); return dep; } }
@Override public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx, Object... nodeOutputs) throws SemanticException { assert (nd instanceof ExprNodeConstantDesc); // Create a dependency that has no basecols Dependency dep = new Dependency(); dep.setType(LineageInfo.DependencyType.SIMPLE); dep.setBaseCols(new LinkedHashSet<BaseColumnInfo>()); return dep; } }
@Override public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx, Object... nodeOutputs) throws SemanticException { assert (nd instanceof ExprNodeGenericFuncDesc || nd instanceof ExprNodeFieldDesc); // Concatenate the dependencies of all the children to compute the new // dependency. Dependency dep = new Dependency(); LinkedHashSet<BaseColumnInfo> bci_set = new LinkedHashSet<BaseColumnInfo>(); LineageInfo.DependencyType new_type = LineageInfo.DependencyType.EXPRESSION; for (Object child : nodeOutputs) { if (child == null) { continue; } Dependency child_dep = (Dependency) child; new_type = LineageCtx.getNewDependencyType(child_dep.getType(), new_type); bci_set.addAll(child_dep.getBaseCols()); } dep.setBaseCols(bci_set); dep.setType(new_type); return dep; }
/** * Merges the new dependencies in dep to the existing dependencies * of (op, ci). * * @param op The operator of the column whose dependency is being modified. * @param ci The column info of the associated column. * @param dependency The new dependency. */ public void mergeDependency(Operator<? extends Serializable> op, ColumnInfo ci, Dependency dep) { Dependency old_dep = getDependency(op, ci); if (old_dep == null) { putDependency(op, ci, dep); } else { LineageInfo.DependencyType new_type = LineageCtx.getNewDependencyType(old_dep.getType(), LineageInfo.DependencyType.EXPRESSION); old_dep.setType(new_type); Set<BaseColumnInfo> bci_set = new LinkedHashSet<BaseColumnInfo>(old_dep.getBaseCols()); bci_set.addAll(dep.getBaseCols()); old_dep.setBaseCols(new ArrayList<BaseColumnInfo>(bci_set)); // TODO: Fix the expressions later. old_dep.setExpr(null); } } }
/** * Merges the new dependencies in dep to the existing dependencies * of (op, ci). * * @param op The operator of the column whose dependency is being modified. * @param ci The column info of the associated column. * @param dep The new dependency. */ public void mergeDependency(Operator<? extends OperatorDesc> op, ColumnInfo ci, Dependency dep) { Dependency old_dep = getDependency(op, ci); if (old_dep == null) { putDependency(op, ci, dep); } else { LineageInfo.DependencyType new_type = LineageCtx.getNewDependencyType(old_dep.getType(), LineageInfo.DependencyType.EXPRESSION); old_dep.setType(new_type); Set<BaseColumnInfo> bci_set = new LinkedHashSet<BaseColumnInfo>(old_dep.getBaseCols()); bci_set.addAll(dep.getBaseCols()); old_dep.setBaseCols(new ArrayList<BaseColumnInfo>(bci_set)); // TODO: Fix the expressions later. old_dep.setExpr(null); } }
@Override public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx, Object... nodeOutputs) throws SemanticException { assert (nd instanceof ExprNodeGenericFuncDesc || nd instanceof ExprNodeFieldDesc); // Concatenate the dependencies of all the children to compute the new // dependency. Dependency dep = new Dependency(); LinkedHashSet<BaseColumnInfo> bci_set = new LinkedHashSet<BaseColumnInfo>(); LineageInfo.DependencyType new_type = LineageInfo.DependencyType.EXPRESSION; for (Object child : nodeOutputs) { if (child == null) { continue; } Dependency child_dep = (Dependency) child; new_type = LineageCtx.getNewDependencyType(child_dep.getType(), new_type); bci_set.addAll(child_dep.getBaseCols()); } dep.setBaseCols(new ArrayList<BaseColumnInfo>(bci_set)); dep.setType(new_type); return dep; }
@Override public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx, Object... nodeOutputs) throws SemanticException { assert (nd instanceof ExprNodeGenericFuncDesc || nd instanceof ExprNodeFieldDesc); // Concatenate the dependencies of all the children to compute the new // dependency. Dependency dep = new Dependency(); LinkedHashSet<BaseColumnInfo> bci_set = new LinkedHashSet<BaseColumnInfo>(); LineageInfo.DependencyType new_type = LineageInfo.DependencyType.EXPRESSION; for (Object child : nodeOutputs) { if (child == null) { continue; } Dependency child_dep = (Dependency) child; new_type = LineageCtx.getNewDependencyType(child_dep.getType(), new_type); bci_set.addAll(child_dep.getBaseCols()); } dep.setBaseCols(new ArrayList<BaseColumnInfo>(bci_set)); dep.setType(new_type); return dep; }
@Override public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx, Object... nodeOutputs) throws SemanticException { assert (nd instanceof ExprNodeConstantDesc || nd instanceof ExprNodeNullDesc); // Create a dependency that has no basecols Dependency dep = new Dependency(); dep.setType(LineageInfo.DependencyType.SIMPLE); dep.setBaseCols(new ArrayList<BaseColumnInfo>()); return dep; } }
@Override public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx, Object... nodeOutputs) throws SemanticException { assert (nd instanceof ExprNodeConstantDesc); // Create a dependency that has no basecols Dependency dep = new Dependency(); dep.setType(LineageInfo.DependencyType.SIMPLE); dep.setBaseCols(new ArrayList<BaseColumnInfo>()); return dep; } }
dep.setType(new_type); lctx.getIndex().putDependency(gop, col_infos.get(cnt++), dep);
dep.setType(new_type); lctx.getIndex().putDependency(gop, col_infos.get(cnt++), dep);
dep.setType(LineageInfo.DependencyType.SIMPLE); dep.setBaseCols(new LinkedHashSet<BaseColumnInfo>()); dep.getBaseCols().add(bci);
dep.setType(LineageInfo.DependencyType.SIMPLE); dep.setBaseCols(new LinkedHashSet<BaseColumnInfo>()); dep.getBaseCols().add(bci);
/** * Merges the new dependencies in dep to the existing dependencies * of (op, ci). * * @param op The operator of the column whose dependency is being modified. * @param ci The column info of the associated column. * @param dep The new dependency. */ public void mergeDependency(Operator<? extends OperatorDesc> op, ColumnInfo ci, Dependency dep) { Dependency old_dep = getDependency(op, ci); if (old_dep == null) { putDependency(op, ci, dep); } else { LineageInfo.DependencyType new_type = LineageCtx.getNewDependencyType(old_dep.getType(), LineageInfo.DependencyType.EXPRESSION); old_dep.setType(new_type); Set<BaseColumnInfo> bci_set = new LinkedHashSet<BaseColumnInfo>(old_dep.getBaseCols()); bci_set.addAll(dep.getBaseCols()); old_dep.setBaseCols(bci_set); // TODO: Fix the expressions later. old_dep.setExpr(null); } }
@Override public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx, Object... nodeOutputs) throws SemanticException { assert (nd instanceof ExprNodeGenericFuncDesc || nd instanceof ExprNodeFieldDesc); // Concatenate the dependencies of all the children to compute the new // dependency. Dependency dep = new Dependency(); LinkedHashSet<BaseColumnInfo> bci_set = new LinkedHashSet<BaseColumnInfo>(); LineageInfo.DependencyType new_type = LineageInfo.DependencyType.EXPRESSION; for (Object child : nodeOutputs) { if (child == null) { continue; } Dependency child_dep = (Dependency) child; new_type = LineageCtx.getNewDependencyType(child_dep.getType(), new_type); bci_set.addAll(child_dep.getBaseCols()); } dep.setBaseCols(bci_set); dep.setType(new_type); return dep; }
/** * Merges the new dependencies in dep to the existing dependencies * of (op, ci). * * @param op The operator of the column whose dependency is being modified. * @param ci The column info of the associated column. * @param dep The new dependency. */ public void mergeDependency(Operator<? extends OperatorDesc> op, ColumnInfo ci, Dependency dep) { Dependency old_dep = getDependency(op, ci); if (old_dep == null) { putDependency(op, ci, dep); } else { LineageInfo.DependencyType new_type = LineageCtx.getNewDependencyType(old_dep.getType(), LineageInfo.DependencyType.EXPRESSION); old_dep.setType(new_type); Set<BaseColumnInfo> bci_set = new LinkedHashSet<BaseColumnInfo>(old_dep.getBaseCols()); bci_set.addAll(dep.getBaseCols()); old_dep.setBaseCols(bci_set); // TODO: Fix the expressions later. old_dep.setExpr(null); } }