@Override public String toString() { return relationNode.getCanonicalName(); }
@Override public String toString() { return relationNode.getCanonicalName(); }
public void addRelation(RelationNode relation) { if (relation.hasAlias()) { TUtil.putToNestedList(relationAliasMap, relation.getTableName(), relation.getCanonicalName()); } canonicalNameToRelationMap.put(relation.getCanonicalName(), relation); relationList.add(relation); relNodePidAccessPathMap.put(relation.getPID(), new ArrayList<AccessPathInfo>()); }
public void addRelation(RelationNode relation) { if (relation.hasAlias()) { TUtil.putToNestedList(relationAliasMap, relation.getTableName(), relation.getCanonicalName()); } canonicalNameToRelationMap.put(relation.getCanonicalName(), relation); relationList.add(relation); relNodePidAccessPathMap.put(relation.getPID(), new ArrayList<>()); }
public void addRelation(RelationNode relation, List<AccessPathInfo> accessPathInfos) { if (relation.hasAlias()) { TUtil.putToNestedList(relationAliasMap, relation.getTableName(), relation.getCanonicalName()); } canonicalNameToRelationMap.put(relation.getCanonicalName(), relation); relationList.add(relation); relNodePidAccessPathMap.put(relation.getPID(), new ArrayList<AccessPathInfo>()); }
public void addRelation(RelationNode relation, List<AccessPathInfo> accessPathInfos) { if (relation.hasAlias()) { TUtil.putToNestedList(relationAliasMap, relation.getTableName(), relation.getCanonicalName()); } canonicalNameToRelationMap.put(relation.getCanonicalName(), relation); relationList.add(relation); relNodePidAccessPathMap.put(relation.getPID(), new ArrayList<>()); }
@Override public LogicalNode visit(Object context, LogicalPlan plan, @Nullable LogicalPlan.QueryBlock block, LogicalNode node, Stack<LogicalNode> stack) throws TajoException { if (topOnly && foundRelNameSet.size() > 0) { return node; } if (node.getType() != NodeType.TABLE_SUBQUERY) { super.visit(context, plan, block, node, stack); } if (node instanceof RelationNode) { foundRelNameSet.add(((RelationNode) node).getCanonicalName()); } return node; } }
@Override public LogicalNode visit(Object context, LogicalPlan plan, @Nullable LogicalPlan.QueryBlock block, LogicalNode node, Stack<LogicalNode> stack) throws TajoException { if (topOnly && foundRelNameSet.size() > 0) { return node; } if (node.getType() != NodeType.TABLE_SUBQUERY) { super.visit(context, plan, block, node, stack); } if (node instanceof RelationNode) { foundRelNameSet.add(((RelationNode) node).getCanonicalName()); } return node; } }
/** * Guess a relation from a table name regardless of whether the given name is qualified or not. * * @param block the current block * @param tableName The table name which can be either qualified or not. * @return A corresponding relation */ public static RelationNode lookupTable(LogicalPlan.QueryBlock block, String tableName) throws AmbiguousTableException { List<RelationNode> found = new ArrayList<>(); for (RelationNode relation : block.getRelations()) { // if a table name is qualified if (relation.getCanonicalName().equals(tableName) || relation.getTableName().equals(tableName)) { found.add(relation); // if a table name is not qualified } else if (IdentifierUtil.extractSimpleName(relation.getCanonicalName()).equals(tableName) || IdentifierUtil.extractSimpleName(relation.getTableName()).equals(tableName)) { found.add(relation); } } if (found.size() == 0) { return null; } else if (found.size() > 1) { throw new AmbiguousTableException(tableName); } return found.get(0); }
/** * Guess a relation from a table name regardless of whether the given name is qualified or not. * * @param block the current block * @param tableName The table name which can be either qualified or not. * @return A corresponding relation */ public static RelationNode lookupTable(LogicalPlan.QueryBlock block, String tableName) throws AmbiguousTableException { List<RelationNode> found = TUtil.newList(); for (RelationNode relation : block.getRelations()) { // if a table name is qualified if (relation.getCanonicalName().equals(tableName) || relation.getTableName().equals(tableName)) { found.add(relation); // if a table name is not qualified } else if (CatalogUtil.extractSimpleName(relation.getCanonicalName()).equals(tableName) || CatalogUtil.extractSimpleName(relation.getTableName()).equals(tableName)) { found.add(relation); } } if (found.size() == 0) { return null; } else if (found.size() > 1) { throw new AmbiguousTableException(tableName); } return found.get(0); }
return guessColumn(IdentifierUtil.buildFQName(candidateRels.get(0).getCanonicalName(), columnName)); } else if (candidateRels.size() > 1) { throw new AmbiguousColumnException(columnName);
return guessColumn(CatalogUtil.buildFQName(candidateRels.get(0).getCanonicalName(), columnName)); } else if (candidateRels.size() > 1) { throw new AmbiguousColumnException(columnName);
String qualifier = guessedRelations.iterator().next().getCanonicalName(); String columnName;
String qualifier = guessedRelations.iterator().next().getCanonicalName(); String columnName;
CatalogUtil.buildFQName(relationOp.getCanonicalName(), CatalogUtil.extractSimpleName(canonicalName));
IdentifierUtil.buildFQName(relationOp.getCanonicalName(), IdentifierUtil.extractSimpleName(canonicalName));