/** * Creates a new HepPlanner with the option to keep the graph a * tree (noDag = true) or allow DAG (noDag = false). * * @param noDag If false, create shared nodes if expressions are * identical * @param program Program controlling rule application * @param onCopyHook Function to call when a node is copied */ public HepPlanner( HepProgram program, Context context, boolean noDag, Function2<RelNode, RelNode, Void> onCopyHook, RelOptCostFactory costFactory) { super(costFactory, context); this.mainProgram = program; this.onCopyHook = Util.first(onCopyHook, Functions.ignore2()); this.noDag = noDag; }
/** * Creates a new HepPlanner with the option to keep the graph a * tree(noDAG=true) or allow DAG(noDAG=false). * * @param program program controlling rule application * @param onCopyHook Function to call when a node is copied */ public HepPlanner( HepProgram program, Context context, boolean noDAG, Function2<RelNode, RelNode, Void> onCopyHook, RelOptCostFactory costFactory) { super(costFactory, context); this.mainProgram = program; this.onCopyHook = Util.first(onCopyHook, Functions.ignore2()); mapDigestToVertex = new HashMap<>(); graph = DefaultDirectedGraph.create(); // NOTE jvs 24-Apr-2006: We use LinkedHashSet here and below // in order to provide deterministic behavior. allRules = new LinkedHashSet<>(); this.noDAG = noDAG; }