private boolean addOrExpandField(List<SqlNode> selectItems, Set<String> aliases, List<Map.Entry<String, RelDataType>> fields, boolean includeSystemVars, SelectScope scope, SqlIdentifier id, RelDataTypeField field) { switch (field.getType().getStructKind()) { case PEEK_FIELDS: case PEEK_FIELDS_DEFAULT: final SqlNode starExp = id.plusStar(); expandStar( selectItems, aliases, fields, includeSystemVars, scope, starExp); return true; default: addToSelectList( selectItems, aliases, fields, id, scope, includeSystemVars); } return false; }
final boolean includeSystemVars) { final SelectScope scope = (SelectScope) getWhereScope(select); if (expandStar(selectItems, aliases, fields, includeSystemVars, scope, selectItem)) { return true;
/** * Returns the <code>ordinal</code>th item in the select list. */ private SqlNode nthSelectItem(int ordinal, final SqlParserPos pos) { // TODO: Don't expand the list every time. Maybe keep an expanded // version of each expression -- select lists and identifiers -- in // the validator. SqlNodeList expandedSelectList = expandStar( select.getSelectList(), select, false); SqlNode expr = expandedSelectList.get(ordinal); expr = stripAs(expr); if (expr instanceof SqlIdentifier) { expr = getScope().fullyQualify((SqlIdentifier) expr).identifier; } // Create a copy of the expression with the position of the order // item. return expr.clone(pos); }
private boolean addOrExpandField(List<SqlNode> selectItems, Set<String> aliases, List<Map.Entry<String, RelDataType>> fields, boolean includeSystemVars, SelectScope scope, SqlIdentifier id, RelDataTypeField field) { switch (field.getType().getStructKind()) { case PEEK_FIELDS: case PEEK_FIELDS_DEFAULT: final SqlNode starExp = id.plusStar(); expandStar( selectItems, aliases, fields, includeSystemVars, scope, starExp); return true; default: addToSelectList( selectItems, aliases, fields, id, scope, includeSystemVars); } return false; }
private boolean addOrExpandField(List<SqlNode> selectItems, Set<String> aliases, List<Map.Entry<String, RelDataType>> fields, boolean includeSystemVars, SelectScope scope, SqlIdentifier id, RelDataTypeField field) { switch (field.getType().getStructKind()) { case PEEK_FIELDS: case PEEK_FIELDS_DEFAULT: final SqlNode starExp = id.plusStar(); expandStar( selectItems, aliases, fields, includeSystemVars, scope, starExp); return true; default: addToSelectList( selectItems, aliases, fields, id, scope, includeSystemVars); } return false; }
final boolean includeSystemVars) { final SelectScope scope = (SelectScope) getWhereScope(select); if (expandStar(selectItems, aliases, fields, includeSystemVars, scope, selectItem)) { return true;
final boolean includeSystemVars) { final SelectScope scope = (SelectScope) getWhereScope(select); if (expandStar(selectItems, aliases, fields, includeSystemVars, scope, selectItem)) { return true;
/** * Returns the <code>ordinal</code>th item in the select list. */ private SqlNode nthSelectItem(int ordinal, final SqlParserPos pos) { // TODO: Don't expand the list every time. Maybe keep an expanded // version of each expression -- select lists and identifiers -- in // the validator. SqlNodeList expandedSelectList = expandStar( select.getSelectList(), select, false); SqlNode expr = expandedSelectList.get(ordinal); expr = stripAs(expr); if (expr instanceof SqlIdentifier) { expr = getScope().fullyQualify((SqlIdentifier) expr).identifier; } // Create a copy of the expression with the position of the order // item. return expr.clone(pos); }
/** * Returns the <code>ordinal</code>th item in the select list. */ private SqlNode nthSelectItem(int ordinal, final SqlParserPos pos) { // TODO: Don't expand the list every time. Maybe keep an expanded // version of each expression -- select lists and identifiers -- in // the validator. SqlNodeList expandedSelectList = expandStar( select.getSelectList(), select, false); SqlNode expr = expandedSelectList.get(ordinal); expr = stripAs(expr); if (expr instanceof SqlIdentifier) { expr = getScope().fullyQualify((SqlIdentifier) expr).identifier; } // Create a copy of the expression with the position of the order // item. return expr.clone(pos); }