org.eigenbase.sql.validate
Interface SqlValidatorWithHints

All Superinterfaces:
SqlValidator
All Known Implementing Classes:
FarragoSqlValidator, LucidDbSqlValidator, SqlAdvisorValidator, SqlToRelTestBase.FarragoTestValidator, SqlValidatorFeatureTest.FeatureValidator, SqlValidatorImpl

public interface SqlValidatorWithHints
extends SqlValidator

Extends SqlValidator to allow discovery of useful data such as fully qualified names of sql objects, alternative valid sql objects that can be used in the SQL statement (dubbed as hints)

Since:
Jul 7, 2005
Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/validate/SqlValidatorWithHints.java#8 $
Author:
tleung

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eigenbase.sql.validate.SqlValidator
SqlValidator.Compatible
 
Method Summary
 List<SqlMoniker> lookupHints(SqlNode topNode, SqlParserPos pos)
          Looks up completion hints for a syntatically correct SQL statement that has been parsed into an expression tree.
 SqlMoniker lookupQualifiedName(SqlNode topNode, SqlParserPos pos)
          Looks up the fully qualified name for a SqlIdentifier at a given Parser Position in a parsed expression tree Note: call this only after SqlValidator.validate(org.eigenbase.sql.SqlNode) has been called.
 
Methods inherited from interface org.eigenbase.sql.validate.SqlValidator
declareCursor, deriveAlias, deriveConstructorType, deriveType, expand, expandOrderExpr, expandStar, getCatalogReader, getConformance, getFromScope, getGroupScope, getHavingScope, getJoinScope, getNamespace, getOperatorTable, getOrderScope, getParentCursor, getRawSelectScope, getSelectScope, getTypeFactory, getUnknownType, getValidatedNodeType, getValidatedNodeTypeIfKnown, getWhereScope, handleUnresolvedFunction, isAggregate, isAggregate, isSystemField, newValidationError, popFunctionCall, pushFunctionCall, removeValidatedNodeType, resolveWindow, setCallRewrite, setColumnReferenceExpansion, setIdentifierExpansion, setValidatedNodeType, shouldExpandIdentifiers, validate, validateAggregateParams, validateCall, validateColumnListParams, validateDataType, validateDelete, validateDynamicParam, validateIdentifier, validateInsert, validateIntervalQualifier, validateLiteral, validateMerge, validateParameterizedExpression, validateQuery, validateUpdate, validateWindow
 

Method Detail

lookupHints

List<SqlMoniker> lookupHints(SqlNode topNode,
                             SqlParserPos pos)
Looks up completion hints for a syntatically correct SQL statement that has been parsed into an expression tree. (Note this should be called after SqlValidator.validate(org.eigenbase.sql.SqlNode).

Parameters:
topNode - top of expression tree in which to lookup completion hints
pos - indicates the position in the sql statement we want to get completion hints for. For example, "select a.ename, b.deptno from sales.emp a join sales.dept b "on a.deptno=b.deptno where empno=1"; setting pos to 'Line 1, Column 17' returns all the possible column names that can be selected from sales.dept table setting pos to 'Line 1, Column 31' returns all the possible table names in 'sales' schema
Returns:
an array of SqlMoniker (sql identifiers) that can fill in at the indicated position

lookupQualifiedName

SqlMoniker lookupQualifiedName(SqlNode topNode,
                               SqlParserPos pos)
Looks up the fully qualified name for a SqlIdentifier at a given Parser Position in a parsed expression tree Note: call this only after SqlValidator.validate(org.eigenbase.sql.SqlNode) has been called.

Parameters:
topNode - top of expression tree in which to lookup the qualfied name for the SqlIdentifier
pos - indicates the position of the SqlIdentifier in the sql statement we want to get the qualified name for
Returns:
a string of the fully qualified name of the SqlIdentifier if the Parser position represents a valid SqlIdentifier. Else return an empty string