Package org.apache.calcite.sql.validate
Interface SqlValidatorWithHints
-
- All Superinterfaces:
SqlValidator
- All Known Implementing Classes:
CalciteSqlValidator
,SqlAdvisorValidator
,SqlValidatorImpl
public interface SqlValidatorWithHints extends SqlValidator
ExtendsSqlValidator
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)
-
-
Field Summary
-
Fields inherited from interface org.apache.calcite.sql.validate.SqlValidator
STRICT
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<SqlMoniker>
lookupHints(SqlNode topNode, SqlParserPos pos)
Looks up completion hints for a syntactically correct SQL statement that has been parsed into an expression tree.SqlMoniker
lookupQualifiedName(SqlNode topNode, SqlParserPos pos)
Looks up the fully qualified name for aSqlIdentifier
at a given Parser Position in a parsed expression tree Note: call this only afterSqlValidator.validate(org.apache.calcite.sql.SqlNode)
has been called.-
Methods inherited from interface org.apache.calcite.sql.validate.SqlValidator
declareCursor, deriveAlias, deriveConstructorType, deriveType, expand, expandOrderExpr, expandStar, getCatalogReader, getColumnReferenceExpansion, getConformance, getDefaultNullCollation, getFieldOrigins, getFromScope, getGroupScope, getHavingScope, getJoinScope, getMatchRecognizeScope, getNamespace, getOperatorTable, getOrderScope, getOverScope, getParameterRowType, getParentCursor, getRawSelectScope, getSelectScope, getTypeFactory, getUnknownType, getValidatedNodeType, getValidatedNodeTypeIfKnown, getWhereScope, getWithScope, handleUnresolvedFunction, isAggregate, isAggregate, isSystemField, newValidationError, popFunctionCall, pushFunctionCall, removeValidatedNodeType, resolveWindow, setCallRewrite, setColumnReferenceExpansion, setDefaultNullCollation, setIdentifierExpansion, setValidatedNodeType, shouldExpandIdentifiers, validate, validateAggregateParams, validateCall, validateColumnListParams, validateDataType, validateDelete, validateDynamicParam, validateIdentifier, validateInsert, validateIntervalQualifier, validateLiteral, validateMatchRecognize, validateMerge, validateModality, validateParameterizedExpression, validateQuery, validateSequenceValue, validateUpdate, validateWindow, validateWith, validateWithItem
-
-
-
-
Method Detail
-
lookupHints
java.util.List<SqlMoniker> lookupHints(SqlNode topNode, SqlParserPos pos)
Looks up completion hints for a syntactically correct SQL statement that has been parsed into an expression tree. (Note this should be called afterSqlValidator.validate(org.apache.calcite.sql.SqlNode)
.- Parameters:
topNode
- top of expression tree in which to lookup completion hintspos
- 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 aSqlIdentifier
at a given Parser Position in a parsed expression tree Note: call this only afterSqlValidator.validate(org.apache.calcite.sql.SqlNode)
has been called.- Parameters:
topNode
- top of expression tree in which to lookup the qualified name for the SqlIdentifierpos
- indicates the position of theSqlIdentifier
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 validSqlIdentifier
. Else return an empty string
-
-