public interface SqlValidatorWithHints extends SqlValidator
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)Modifier and Type | Method and 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 a
SqlIdentifier at a given
Parser Position in a parsed expression tree Note: call this only after
SqlValidator.validate(org.apache.calcite.sql.SqlNode) has been called. |
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, makeNullaryCall, 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
java.util.List<SqlMoniker> lookupHints(SqlNode topNode, SqlParserPos pos)
SqlValidator.validate(org.apache.calcite.sql.SqlNode)
.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' schemaSqlMoniker
(sql identifiers) that can fill in
at the indicated positionSqlMoniker lookupQualifiedName(SqlNode topNode, SqlParserPos pos)
SqlIdentifier
at a given
Parser Position in a parsed expression tree Note: call this only after
SqlValidator.validate(org.apache.calcite.sql.SqlNode)
has been called.topNode
- top of expression tree in which to lookup the qualified
name for the SqlIdentifierpos
- indicates the position of the SqlIdentifier
in
the SQL statement we want to get the qualified
name forSqlIdentifier
if the Parser position represents a valid SqlIdentifier
. Else
return an empty stringCopyright © 2012–2019 The Apache Software Foundation. All rights reserved.