/** Returns the set of field names in the join condition specified by USING * or implicitly by NATURAL, de-duplicated and in order. */ private List<String> usingNames(SqlJoin join) { switch (join.getConditionType()) { case USING: final ImmutableList.Builder<String> list = ImmutableList.builder(); final Set<String> names = catalogReader.nameMatcher().createSet(); for (SqlNode node : (SqlNodeList) join.getCondition()) { final String name = ((SqlIdentifier) node).getSimple(); if (names.add(name)) { list.add(name); } } return list.build(); case NONE: if (join.isNatural()) { final RelDataType t0 = getValidatedNodeType(join.getLeft()); final RelDataType t1 = getValidatedNodeType(join.getRight()); return SqlValidatorUtil.deriveNaturalJoinColumnList( catalogReader.nameMatcher(), t0, t1); } } return null; }
public SqlNodeList expandStar( SqlNodeList selectList, SqlSelect select, boolean includeSystemVars) { final List<SqlNode> list = new ArrayList<>(); final List<Map.Entry<String, RelDataType>> types = new ArrayList<>(); for (int i = 0; i < selectList.size(); i++) { final SqlNode selectItem = selectList.get(i); final RelDataType originalType = getValidatedNodeTypeIfKnown(selectItem); expandSelectItem( selectItem, select, Util.first(originalType, unknownType), list, catalogReader.nameMatcher().createSet(), types, includeSystemVars); } getRawSelectScope(select).setExpandedSelectList(list); return new SqlNodeList(list, SqlParserPos.ZERO); }
private void validateDefinitions(SqlMatchRecognize mr, MatchRecognizeScope scope) { final Set<String> aliases = catalogReader.nameMatcher().createSet(); for (SqlNode item : mr.getPatternDefList().getList()) { final String alias = alias(item);
/** Creates a MatchRecognizeScope. */ public MatchRecognizeScope(SqlValidatorScope parent, SqlMatchRecognize matchRecognize) { super(parent); this.matchRecognize = matchRecognize; patternVars = validator.getCatalogReader().nameMatcher().createSet(); patternVars.add(STAR); }
/** Creates a MatchRecognizeScope. */ public MatchRecognizeScope(SqlValidatorScope parent, SqlMatchRecognize matchRecognize) { super(parent); this.matchRecognize = matchRecognize; patternVars = validator.getCatalogReader().nameMatcher().createSet(); patternVars.add(STAR); }
/** Returns the set of field names in the join condition specified by USING * or implicitly by NATURAL, de-duplicated and in order. */ private List<String> usingNames(SqlJoin join) { switch (join.getConditionType()) { case USING: final ImmutableList.Builder<String> list = ImmutableList.builder(); final Set<String> names = catalogReader.nameMatcher().createSet(); for (SqlNode node : (SqlNodeList) join.getCondition()) { final String name = ((SqlIdentifier) node).getSimple(); if (names.add(name)) { list.add(name); } } return list.build(); case NONE: if (join.isNatural()) { final RelDataType t0 = getValidatedNodeType(join.getLeft()); final RelDataType t1 = getValidatedNodeType(join.getRight()); return SqlValidatorUtil.deriveNaturalJoinColumnList( catalogReader.nameMatcher(), t0, t1); } } return null; }
/** Returns the set of field names in the join condition specified by USING * or implicitly by NATURAL, de-duplicated and in order. */ private List<String> usingNames(SqlJoin join) { switch (join.getConditionType()) { case USING: final ImmutableList.Builder<String> list = ImmutableList.builder(); final Set<String> names = catalogReader.nameMatcher().createSet(); for (SqlNode node : (SqlNodeList) join.getCondition()) { final String name = ((SqlIdentifier) node).getSimple(); if (names.add(name)) { list.add(name); } } return list.build(); case NONE: if (join.isNatural()) { final RelDataType t0 = getValidatedNodeType(join.getLeft()); final RelDataType t1 = getValidatedNodeType(join.getRight()); return SqlValidatorUtil.deriveNaturalJoinColumnList( catalogReader.nameMatcher(), t0, t1); } } return null; }
public SqlNodeList expandStar( SqlNodeList selectList, SqlSelect select, boolean includeSystemVars) { final List<SqlNode> list = new ArrayList<>(); final List<Map.Entry<String, RelDataType>> types = new ArrayList<>(); for (int i = 0; i < selectList.size(); i++) { final SqlNode selectItem = selectList.get(i); final RelDataType originalType = getValidatedNodeTypeIfKnown(selectItem); expandSelectItem( selectItem, select, Util.first(originalType, unknownType), list, catalogReader.nameMatcher().createSet(), types, includeSystemVars); } getRawSelectScope(select).setExpandedSelectList(list); return new SqlNodeList(list, SqlParserPos.ZERO); }
public SqlNodeList expandStar( SqlNodeList selectList, SqlSelect select, boolean includeSystemVars) { final List<SqlNode> list = new ArrayList<>(); final List<Map.Entry<String, RelDataType>> types = new ArrayList<>(); for (int i = 0; i < selectList.size(); i++) { final SqlNode selectItem = selectList.get(i); final RelDataType originalType = getValidatedNodeTypeIfKnown(selectItem); expandSelectItem( selectItem, select, Util.first(originalType, unknownType), list, catalogReader.nameMatcher().createSet(), types, includeSystemVars); } getRawSelectScope(select).setExpandedSelectList(list); return new SqlNodeList(list, SqlParserPos.ZERO); }
private void validateDefinitions(SqlMatchRecognize mr, MatchRecognizeScope scope) { final Set<String> aliases = catalogReader.nameMatcher().createSet(); for (SqlNode item : mr.getPatternDefList().getList()) { final String alias = alias(item);
private void validateDefinitions(SqlMatchRecognize mr, MatchRecognizeScope scope) { final Set<String> aliases = catalogReader.nameMatcher().createSet(); for (SqlNode item : mr.getPatternDefList().getList()) { final String alias = alias(item);