@Override public RESULT visitCreateTable(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, CreateTableNode node, Stack<LogicalNode> stack) throws TajoException { RESULT result = null; stack.push(node); if (node.hasSubQuery()) { result = visit(context, plan, block, node.getChild(), stack); } stack.pop(); return result; }
@Override public RESULT visitCreateTable(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, CreateTableNode node, Stack<LogicalNode> stack) throws TajoException { RESULT result = null; stack.push(node); if (node.hasSubQuery()) { result = visit(context, plan, block, node.getChild(), stack); } stack.pop(); return result; }
@Override public void preOrder(LogicalNodeVisitor visitor) { if (hasSubQuery()) { child.preOrder(visitor); } visitor.visit(this); }
@Override public void postOrder(LogicalNodeVisitor visitor) { visitor.visit(this); if (hasSubQuery()) { child.preOrder(visitor); } } }
@Override public void preOrder(LogicalNodeVisitor visitor) { if (hasSubQuery()) { child.preOrder(visitor); } visitor.visit(this); }
@Override public void postOrder(LogicalNodeVisitor visitor) { visitor.visit(this); if (hasSubQuery()) { child.preOrder(visitor); } } }
public static boolean checkIfDDLPlan(LogicalNode node) { LogicalNode baseNode = node; if (node instanceof LogicalRootNode) { baseNode = ((LogicalRootNode) node).getChild(); } NodeType type = baseNode.getType(); return type == NodeType.CREATE_DATABASE || type == NodeType.DROP_DATABASE || (type == NodeType.CREATE_TABLE && !((CreateTableNode) baseNode).hasSubQuery()) || type == NodeType.DROP_TABLE || type == NodeType.ALTER_TABLESPACE || type == NodeType.ALTER_TABLE || type == NodeType.TRUNCATE_TABLE || type == NodeType.CREATE_INDEX || type == NodeType.DROP_INDEX; }
public static boolean checkIfDDLPlan(LogicalNode node) { LogicalNode baseNode = node; if (node instanceof LogicalRootNode) { baseNode = ((LogicalRootNode) node).getChild(); } NodeType type = baseNode.getType(); return type == NodeType.CREATE_DATABASE || type == NodeType.DROP_DATABASE || (type == NodeType.CREATE_TABLE && !((CreateTableNode) baseNode).hasSubQuery()) || type == NodeType.DROP_TABLE || type == NodeType.ALTER_TABLESPACE || type == NodeType.ALTER_TABLE || type == NodeType.TRUNCATE_TABLE || type == NodeType.CREATE_INDEX || type == NodeType.DROP_INDEX; }
/** * Most update queries require only the updates to the catalog information, * but some queries such as "CREATE INDEX" or CTAS requires distributed execution on multiple cluster nodes. * This function checks whether the given DDL plan requires distributed execution or not. * @param node the root node of a query plan * @return Return true if the input query plan requires distributed execution. Otherwise, return false. */ public static boolean isDistExecDDL(LogicalNode node) { LogicalNode baseNode = node; if (node instanceof LogicalRootNode) { baseNode = ((LogicalRootNode) node).getChild(); } NodeType type = baseNode.getType(); return type == NodeType.CREATE_INDEX && !((CreateIndexNode)baseNode).isExternal() || type == NodeType.CREATE_TABLE && ((CreateTableNode)baseNode).hasSubQuery(); }
/** * Most update queries require only the updates to the catalog information, * but some queries such as "CREATE INDEX" or CTAS requires distributed execution on multiple cluster nodes. * This function checks whether the given DDL plan requires distributed execution or not. * @param node the root node of a query plan * @return Return true if the input query plan requires distributed execution. Otherwise, return false. */ public static boolean isDistExecDDL(LogicalNode node) { LogicalNode baseNode = node; if (node instanceof LogicalRootNode) { baseNode = ((LogicalRootNode) node).getChild(); } NodeType type = baseNode.getType(); return type == NodeType.CREATE_INDEX && !((CreateIndexNode)baseNode).isExternal() || type == NodeType.CREATE_TABLE && ((CreateTableNode)baseNode).hasSubQuery(); }
@Override public LogicalNode visitCreateTable(Context context, LogicalPlan plan, LogicalPlan.QueryBlock block, CreateTableNode node, Stack<LogicalNode> stack) throws TajoException { super.visitCreateTable(context, plan, block, node, stack); // here, we don't need check table existence because this check is performed in PreLogicalPlanVerifier. if (node.hasSubQuery()) { ensureDomains(context.state, node.getLogicalSchema(), node.getChild(0).getOutSchema()); } return node; }
@Override public LogicalNode visitCreateTable(Context context, LogicalPlan plan, LogicalPlan.QueryBlock block, CreateTableNode node, Stack<LogicalNode> stack) throws TajoException { super.visitCreateTable(context, plan, block, node, stack); // here, we don't need check table existence because this check is performed in PreLogicalPlanVerifier. if (node.hasSubQuery()) { ensureDomains(context.state, node.getLogicalSchema(), node.getChild(0).getOutSchema()); } return node; }