@Override public Object clone() throws CloneNotSupportedException { CreateDatabaseNode newNode = (CreateDatabaseNode) super.clone(); newNode.databaseName = databaseName; newNode.ifNotExists = ifNotExists; return newNode; }
@Override public Object clone() throws CloneNotSupportedException { DropIndexNode clone = (DropIndexNode) super.clone(); clone.indexName = this.indexName; return clone; }
@Override public Object clone() throws CloneNotSupportedException { DropDatabaseNode dropTableNode = (DropDatabaseNode) super.clone(); dropTableNode.databaseName = databaseName; return dropTableNode; }
@Override public Object clone() throws CloneNotSupportedException { DropDatabaseNode dropTableNode = (DropDatabaseNode) super.clone(); dropTableNode.databaseName = databaseName; return dropTableNode; }
@Override public Object clone() throws CloneNotSupportedException { DropTableNode dropTableNode = (DropTableNode) super.clone(); dropTableNode.tableName = tableName; dropTableNode.ifExists = ifExists; dropTableNode.purge = purge; return dropTableNode; }
@Override public Object clone() throws CloneNotSupportedException { DropIndexNode clone = (DropIndexNode) super.clone(); clone.indexName = this.indexName; return clone; }
@Override public Object clone() throws CloneNotSupportedException { AlterTablespaceNode alter = (AlterTablespaceNode) super.clone(); alter.tablespaceName = tablespaceName; alter.setType = setType; alter.uri = uri; return alter; }
@Override public Object clone() throws CloneNotSupportedException { CreateDatabaseNode newNode = (CreateDatabaseNode) super.clone(); newNode.databaseName = databaseName; newNode.ifNotExists = ifNotExists; return newNode; }
@Override public Object clone() throws CloneNotSupportedException { DropTableNode dropTableNode = (DropTableNode) super.clone(); dropTableNode.tableName = tableName; dropTableNode.ifExists = ifExists; dropTableNode.purge = purge; return dropTableNode; }
@Override public Object clone() throws CloneNotSupportedException { AlterTablespaceNode alter = (AlterTablespaceNode) super.clone(); alter.tablespaceName = tablespaceName; alter.setType = setType; alter.uri = uri; return alter; }
@Override public Object clone() throws CloneNotSupportedException { TableSubQueryNode newTableSubQueryNode = (TableSubQueryNode) super.clone(); newTableSubQueryNode.tableName = tableName; newTableSubQueryNode.subQuery = (LogicalNode) subQuery.clone(); if (hasTargets()) { newTableSubQueryNode.targets = new ArrayList<>(); for (Target t : targets) { newTableSubQueryNode.targets.add((Target) t.clone()); } } return newTableSubQueryNode; }
@Override public Object clone() throws CloneNotSupportedException { TableSubQueryNode newTableSubQueryNode = (TableSubQueryNode) super.clone(); newTableSubQueryNode.tableName = tableName; newTableSubQueryNode.subQuery = (LogicalNode) subQuery.clone(); if (hasTargets()) { newTableSubQueryNode.targets = new Target[targets.length]; for (int i = 0; i < targets.length; i++) { newTableSubQueryNode.targets[i] = (Target) targets[i].clone(); } } return newTableSubQueryNode; }
public static final void testCloneLogicalNode(LogicalNode n1) throws CloneNotSupportedException { LogicalNode copy = (LogicalNode) n1.clone(); assertTrue(n1.deepEquals(copy)); }
public static <T extends LogicalNode> T clone(LogicalPlan plan, LogicalNode node) { try { T copy = (T) node.clone(); if (plan == null) { copy.setPID(-1); } else { copy.setPID(plan.newPID()); if (node instanceof DistinctGroupbyNode) { DistinctGroupbyNode dNode = (DistinctGroupbyNode)copy; for (GroupbyNode eachNode: dNode.getSubPlans()) { eachNode.setPID(plan.newPID()); } } } return copy; } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } }
public static <T extends LogicalNode> T clone(LogicalPlan plan, LogicalNode node) { try { T copy = (T) node.clone(); if (plan == null) { copy.setPID(-1); } else { copy.setPID(plan.newPID()); if (node instanceof DistinctGroupbyNode) { DistinctGroupbyNode dNode = (DistinctGroupbyNode)copy; for (GroupbyNode eachNode: dNode.getSubPlans()) { eachNode.setPID(plan.newPID()); } } } return copy; } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } }
@Test public final void testUnionPlan() throws IOException, TajoException, CloneNotSupportedException { FileFragment[] frags = FileTablespace.splitNG(conf, "default.employee", employee.getMeta(), new Path(employee.getUri()), Integer.MAX_VALUE); Path workDir = CommonTestingUtil.getTestDir(TajoTestingCluster.DEFAULT_TEST_DIRECTORY + "/testUnionPlan"); TaskAttemptContext ctx = new TaskAttemptContext(new QueryContext(conf), LocalTajoTestingUtility.newTaskAttemptId(masterPlan), new FileFragment[] { frags[0] }, workDir); ctx.setEnforcer(new Enforcer()); Expr context = analyzer.parse(QUERIES[0]); LogicalPlan plan = planner.createPlan(defaultContext, context); LogicalNode rootNode = optimizer.optimize(plan); LogicalRootNode root = (LogicalRootNode) rootNode; UnionNode union = plan.createNode(UnionNode.class); union.setLeftChild((LogicalNode) root.getChild().clone()); union.setRightChild((LogicalNode) root.getChild().clone()); root.setChild(union); PhysicalPlanner phyPlanner = new PhysicalPlannerImpl(conf); PhysicalExec exec = phyPlanner.createPlan(ctx, root); int count = 0; exec.init(); while(exec.next() != null) { count++; } exec.close(); assertEquals(200, count); }