identifier = bb.scope.fullyQualify(identifier); namespace = bb.scope.resolve(identifier.names.get(0), null, null);
public SqlNode visit(SqlIdentifier id) { return getScope().fullyQualify(id); }
public SqlNode visit(SqlIdentifier id) { return getScope().fullyQualify(id); }
public SqlMoniker lookupQualifiedName(SqlNode topNode, SqlParserPos pos) { final String posString = pos.toString(); IdInfo info = idPositions.get(posString); if (info != null) { return new SqlIdentifierMoniker(info.scope.fullyQualify(info.id)); } else { return null; } }
public SqlMoniker lookupQualifiedName(SqlNode topNode, SqlParserPos pos) { final String posString = pos.toString(); IdInfo info = idPositions.get(posString); if (info != null) { return new SqlIdentifierMoniker(info.scope.fullyQualify(info.id)); } else { return null; } }
public void validateIdentifier(SqlIdentifier id, SqlValidatorScope scope) { final SqlIdentifier fqId = scope.fullyQualify(id); if (expandColumnReferences) { // NOTE jvs 9-Apr-2007: this doesn't cover ORDER BY, which has its // own ideas about qualification. id.assignNamesFrom(fqId); } else { Util.discard(fqId); } }
public void validateIdentifier(SqlIdentifier id, SqlValidatorScope scope) { final SqlIdentifier fqId = scope.fullyQualify(id); if (expandColumnReferences) { // NOTE jvs 9-Apr-2007: this doesn't cover ORDER BY, which has its // own ideas about qualification. id.assignNamesFrom(fqId); } else { Util.discard(fqId); } }
public SqlMonotonicity getMonotonicity(SqlValidatorScope scope) { // First check for builtin functions which don't have parentheses, // like "LOCALTIME". final SqlValidator validator = scope.getValidator(); SqlCall call = SqlUtil.makeCall( validator.getOperatorTable(), this); if (call != null) { return call.getMonotonicity(scope); } final SqlIdentifier fqId = scope.fullyQualify(this); final SqlValidatorNamespace ns = SqlValidatorUtil.lookup( scope, Arrays.asList(fqId.names).subList(0, fqId.names.length - 1)); return ns.getMonotonicity(fqId.names[fqId.names.length - 1]); }
public SqlNode visit(SqlIdentifier id) { // First check for builtin functions which don't have // parentheses, like "LOCALTIME". SqlCall call = SqlUtil.makeCall( validator.getOperatorTable(), id); if (call != null) { return call.accept(this); } final SqlIdentifier fqId = getScope().fullyQualify(id); validator.setOriginal(fqId, id); return fqId; }
public SqlNode visit(SqlIdentifier id) { // First check for builtin functions which don't have // parentheses, like "LOCALTIME". SqlCall call = SqlUtil.makeCall( validator.getOperatorTable(), id); if (call != null) { return call.accept(this); } final SqlIdentifier fqId = getScope().fullyQualify(id); validator.setOriginal(fqId, id); return fqId; }
/** * 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); } // Create a copy of the expression with the position of the order // item. return expr.clone(pos); }
identifier = bb.scope.fullyQualify(identifier); namespace = bb.scope.resolve(identifier.names.get(0), null, null);
/** * 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); if (expr instanceof SqlCall) { SqlCall call = (SqlCall) expr; if (call.getOperator() == SqlStdOperatorTable.asOperator) { expr = call.operands[0]; } } if (expr instanceof SqlIdentifier) { expr = getScope().fullyQualify((SqlIdentifier) expr); } // Create a copy of the expression with the position of the order // item. return expr.clone(pos); }
public SqlMonotonicity getMonotonicity(SqlValidatorScope scope) { // First check for builtin functions which don't have parentheses, // like "LOCALTIME". final SqlValidator validator = scope.getValidator(); SqlCall call = SqlUtil.makeCall( validator.getOperatorTable(), this); if (call != null) { return call.getMonotonicity(scope); } final SqlIdentifier fqId = scope.fullyQualify(this); final SqlValidatorNamespace ns = SqlValidatorUtil.lookup(scope, Util.skipLast(fqId.names)); return ns.resolve().getMonotonicity(Util.last(fqId.names)); } }
identifier = bb.scope.fullyQualify(identifier); namespace = bb.scope.resolve(identifier.names[0], null, null);
final SqlIdentifier fqId = scopes.peek().fullyQualify(id); if (isGroupExpr(fqId)) { return null;
final SqlIdentifier fqId = scopes.peek().fullyQualify(id); if (isGroupExpr(fqId)) { return null;
public SqlNode visit(SqlIdentifier id) { // Aliases, e.g. 'select a as x, b from t order by x'. if (id.isSimple() && getConformance().isSortByAlias()) { String alias = id.getSimple(); final SqlValidatorNamespace selectNs = getNamespace(select); final RelDataType rowType = selectNs.getRowTypeSansSystemColumns(); RelDataTypeField field = catalogReader.field(rowType, alias); if (field != null) { return nthSelectItem( field.getIndex(), id.getParserPosition()); } } // No match. Return identifier unchanged. return getScope().fullyQualify(id); }
public SqlNode visit(SqlIdentifier id) { // Aliases, e.g. 'select a as x, b from t order by x'. if (id.isSimple() && getConformance().isSortByAlias()) { String alias = id.getSimple(); final SqlValidatorNamespace selectNs = getNamespace(select); final RelDataType rowType = selectNs.getRowTypeSansSystemColumns(); RelDataTypeField field = SqlValidatorUtil.lookupField(rowType, alias); if (field != null) { return nthSelectItem( field.getIndex(), id.getParserPosition()); } } // No match. Return identifier unchanged. return getScope().fullyQualify(id); }
id = scope.fullyQualify(id);