/** If there is at least one call to an aggregate function, returns the * first. */ private SqlNode getAgg(SqlSelect select) { final SelectScope selectScope = getRawSelectScope(select); if (selectScope != null) { final List<SqlNode> selectList = selectScope.getExpandedSelectList(); if (selectList != null) { return aggFinder.findAgg(selectList); } } return aggFinder.findAgg(select.getSelectList()); }
private List<String> getFieldOrigin(SqlNode sqlQuery, int i) { if (sqlQuery instanceof SqlSelect) { SqlSelect sqlSelect = (SqlSelect) sqlQuery; final SelectScope scope = getRawSelectScope(sqlSelect); final List<SqlNode> selectList = scope.getExpandedSelectList(); final SqlNode selectItem = stripAs(selectList.get(i));
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); }
select.setSelectList(newSelectList); getRawSelectScope(select).setExpandedSelectList(expandedSelectItems);
public boolean validateModality(SqlSelect select, SqlModality modality, boolean fail) { final SelectScope scope = getRawSelectScope(select);
public SqlMonotonicity getMonotonicity(String columnName) { final RelDataType rowType = this.getRowTypeSansSystemColumns(); final int field = SqlTypeUtil.findField(rowType, columnName); final SqlNode selectItem = validator.getRawSelectScope(select) .getExpandedSelectList().get(field); return validator.getSelectScope(select).getMonotonicity(selectItem); } }
/** If there is at least one call to an aggregate function, returns the * first. */ private SqlNode getAgg(SqlSelect select) { final SelectScope selectScope = getRawSelectScope(select); if (selectScope != null) { final List<SqlNode> selectList = selectScope.getExpandedSelectList(); if (selectList != null) { return aggFinder.findAgg(selectList); } } return aggFinder.findAgg(select.getSelectList()); }
public SqlMonotonicity getMonotonicity(String columnName) { final RelDataType rowType = this.getRowTypeSansSystemColumns(); final int field = SqlTypeUtil.findField(rowType, columnName); final SqlNode selectItem = validator.getRawSelectScope(select) .getExpandedSelectList().get(field); return validator.getSelectScope(select).getMonotonicity(selectItem); } }
/** If there is at least one call to an aggregate function, returns the * first. */ private SqlNode getAgg(SqlSelect select) { final SelectScope selectScope = getRawSelectScope(select); if (selectScope != null) { final List<SqlNode> selectList = selectScope.getExpandedSelectList(); if (selectList != null) { return aggFinder.findAgg(selectList); } } return aggFinder.findAgg(select.getSelectList()); }
private List<String> getFieldOrigin(SqlNode sqlQuery, int i) { if (sqlQuery instanceof SqlSelect) { SqlSelect sqlSelect = (SqlSelect) sqlQuery; final SelectScope scope = getRawSelectScope(sqlSelect); final List<SqlNode> selectList = scope.getExpandedSelectList(); final SqlNode selectItem = stripAs(selectList.get(i));
private List<String> getFieldOrigin(SqlNode sqlQuery, int i) { if (sqlQuery instanceof SqlSelect) { SqlSelect sqlSelect = (SqlSelect) sqlQuery; final SelectScope scope = getRawSelectScope(sqlSelect); final List<SqlNode> selectList = scope.getExpandedSelectList(); final SqlNode selectItem = stripAs(selectList.get(i));
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); }
select.setSelectList(newSelectList); getRawSelectScope(select).setExpandedSelectList(expandedSelectItems);
select.setSelectList(newSelectList); getRawSelectScope(select).setExpandedSelectList(expandedSelectItems);
public boolean validateModality(SqlSelect select, SqlModality modality, boolean fail) { final SelectScope scope = getRawSelectScope(select);
public boolean validateModality(SqlSelect select, SqlModality modality, boolean fail) { final SelectScope scope = getRawSelectScope(select);