public SqlMoniker lookupQualifiedName(SqlNode topNode, SqlParserPos pos) { final String posString = pos.toString(); IdInfo info = idPositions.get(posString); if (info != null) { final SqlQualified qualified = info.scope.fullyQualify(info.id); return new SqlIdentifierMoniker(qualified.identifier); } else { return null; } }
/** * Looks up completion hints for a syntactically correct select SQL that has * been parsed into an expression tree. * * @param select the Select node of the parsed expression tree * @param pos indicates the position in the sql statement we want to get * completion hints for * @param hintList list of {@link SqlMoniker} (sql identifiers) that can * fill in at the indicated position */ void lookupSelectHints( SqlSelect select, SqlParserPos pos, Collection<SqlMoniker> hintList) { IdInfo info = idPositions.get(pos.toString()); if ((info == null) || (info.scope == null)) { SqlNode fromNode = select.getFrom(); final SqlValidatorScope fromScope = getFromScope(select); lookupFromHints(fromNode, fromScope, pos, hintList); } else { lookupNameCompletionHints(info.scope, info.id.names, info.id.getParserPosition(), hintList); } }
public SqlMoniker lookupQualifiedName(SqlNode topNode, SqlParserPos pos) { final String posString = pos.toString(); IdInfo info = idPositions.get(posString); if (info != null) { final SqlQualified qualified = info.scope.fullyQualify(info.id); return new SqlIdentifierMoniker(qualified.identifier); } else { return null; } }
public SqlMoniker lookupQualifiedName(SqlNode topNode, SqlParserPos pos) { final String posString = pos.toString(); IdInfo info = idPositions.get(posString); if (info != null) { final SqlQualified qualified = info.scope.fullyQualify(info.id); return new SqlIdentifierMoniker(qualified.identifier); } else { return null; } }
public void findValidOptions( SqlValidator validator, SqlValidatorScope scope, SqlParserPos pos, Collection<SqlMoniker> hintList) { for (SqlNode operand : getOperandList()) { if (operand instanceof SqlIdentifier) { SqlIdentifier id = (SqlIdentifier) operand; SqlParserPos idPos = id.getParserPosition(); if (idPos.toString().equals(pos.toString())) { ((SqlValidatorImpl) validator).lookupNameCompletionHints( scope, id.names, pos, hintList); return; } } } // no valid options }
public void findValidOptions( SqlValidator validator, SqlValidatorScope scope, SqlParserPos pos, Collection<SqlMoniker> hintList) { for (SqlNode operand : getOperandList()) { if (operand instanceof SqlIdentifier) { SqlIdentifier id = (SqlIdentifier) operand; SqlParserPos idPos = id.getParserPosition(); if (idPos.toString().equals(pos.toString())) { ((SqlValidatorImpl) validator).lookupNameCompletionHints( scope, id.names, pos, hintList); return; } } } // no valid options }
private void registerId(SqlIdentifier id, SqlValidatorScope scope) { for (int i = 0; i < id.names.size(); i++) { final SqlParserPos subPos = id.getComponentParserPosition(i); SqlIdentifier subId = i == id.names.size() - 1 ? id : new SqlIdentifier(id.names.subList(0, i + 1), subPos); idPositions.put(subPos.toString(), new IdInfo(scope, subId)); } }
private void registerId(SqlIdentifier id, SqlValidatorScope scope) { for (int i = 0; i < id.names.size(); i++) { final SqlParserPos subPos = id.getComponentParserPosition(i); SqlIdentifier subId = i == id.names.size() - 1 ? id : new SqlIdentifier(id.names.subList(0, i + 1), subPos); idPositions.put(subPos.toString(), new IdInfo(scope, subId)); } }
/** * Looks up completion hints for a syntactically correct select SQL that has * been parsed into an expression tree. * * @param select the Select node of the parsed expression tree * @param pos indicates the position in the sql statement we want to get * completion hints for * @param hintList list of {@link SqlMoniker} (sql identifiers) that can * fill in at the indicated position */ void lookupSelectHints( SqlSelect select, SqlParserPos pos, Collection<SqlMoniker> hintList) { IdInfo info = idPositions.get(pos.toString()); if ((info == null) || (info.scope == null)) { SqlNode fromNode = select.getFrom(); final SqlValidatorScope fromScope = getFromScope(select); lookupFromHints(fromNode, fromScope, pos, hintList); } else { lookupNameCompletionHints(info.scope, info.id.names, info.id.getParserPosition(), hintList); } }
/** * Looks up completion hints for a syntactically correct select SQL that has * been parsed into an expression tree. * * @param select the Select node of the parsed expression tree * @param pos indicates the position in the sql statement we want to get * completion hints for * @param hintList list of {@link SqlMoniker} (sql identifiers) that can * fill in at the indicated position */ void lookupSelectHints( SqlSelect select, SqlParserPos pos, Collection<SqlMoniker> hintList) { IdInfo info = idPositions.get(pos.toString()); if ((info == null) || (info.scope == null)) { SqlNode fromNode = select.getFrom(); final SqlValidatorScope fromScope = getFromScope(select); lookupFromHints(fromNode, fromScope, pos, hintList); } else { lookupNameCompletionHints(info.scope, info.id.names, info.id.getParserPosition(), hintList); } }