|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.sql.validate.SqlValidatorImpl org.eigenbase.sql.advise.SqlAdvisorValidator
public class SqlAdvisorValidator
SqlAdvisorValidator
is used by SqlAdvisor
to traverse
the parse tree of a SQL statement, not for validation purpose but for setting
up the scopes and namespaces to facilitate retrieval of SQL statement
completion hints.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.eigenbase.sql.validate.SqlValidatorImpl |
---|
SqlValidatorImpl.DmlNamespace, SqlValidatorImpl.FunctionParamInfo, SqlValidatorImpl.IdInfo, SqlValidatorImpl.Status |
Nested classes/interfaces inherited from interface org.eigenbase.sql.validate.SqlValidator |
---|
SqlValidator.Compatible |
Field Summary | |
---|---|
private Set<SqlValidatorNamespace> |
activeNamespaces
|
private RelDataType |
emptyStructType
|
Fields inherited from class org.eigenbase.sql.validate.SqlValidatorImpl |
---|
expandColumnReferences, expandIdentifiers, functionCallStack, idPositions, namespaces, scopes, tracer, typeFactory, unknownType, UPDATE_ANON_PREFIX, UPDATE_SRC_ALIAS, UPDATE_TGT_ALIAS |
Constructor Summary | |
---|---|
SqlAdvisorValidator(SqlOperatorTable opTab,
SqlValidatorCatalogReader catalogReader,
RelDataTypeFactory typeFactory,
SqlConformance conformance)
Creates a SqlAdvisor validator. |
Method Summary | |
---|---|
RelDataType |
deriveType(SqlValidatorScope scope,
SqlNode operand)
Calls the parent class method and mask Farrago exception thrown. |
SqlNode |
expand(SqlNode expr,
SqlValidatorScope scope)
Expands an expression. |
SqlNode |
expandOrderExpr(SqlSelect select,
SqlNode orderExpr)
Expands an expression in the ORDER BY clause into an expression with the same semantics as expressions in the SELECT clause. |
private void |
registerId(SqlIdentifier id,
SqlValidatorScope scope)
|
protected boolean |
shouldAllowOverRelation()
|
protected void |
validateFrom(SqlNode node,
RelDataType targetRowType,
SqlValidatorScope scope)
Validates the FROM clause of a query, or (recursively) a child node of the FROM clause: AS, OVER, JOIN, VALUES, or subquery. |
protected void |
validateHavingClause(SqlSelect select)
Calls the parent class method and masks Farrago exception thrown. |
void |
validateIdentifier(SqlIdentifier id,
SqlValidatorScope scope)
Registers the identifier and its scope into a map keyed by ParserPostion. |
protected void |
validateNamespace(SqlValidatorNamespace namespace)
Validates a namespace. |
protected void |
validateOver(SqlCall call,
SqlValidatorScope scope)
|
protected void |
validateWhereClause(SqlSelect select)
Calls the parent class method and masks Farrago exception thrown. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final Set<SqlValidatorNamespace> activeNamespaces
private final RelDataType emptyStructType
Constructor Detail |
---|
public SqlAdvisorValidator(SqlOperatorTable opTab, SqlValidatorCatalogReader catalogReader, RelDataTypeFactory typeFactory, SqlConformance conformance)
opTab
- Operator tablecatalogReader
- Catalog readertypeFactory
- Type factoryconformance
- Compatibility modeMethod Detail |
---|
public void validateIdentifier(SqlIdentifier id, SqlValidatorScope scope)
validateIdentifier
in interface SqlValidator
validateIdentifier
in class SqlValidatorImpl
id
- Identifierscope
- Naming scopeprivate void registerId(SqlIdentifier id, SqlValidatorScope scope)
public SqlNode expand(SqlNode expr, SqlValidatorScope scope)
SqlValidator
expand
in interface SqlValidator
expand
in class SqlValidatorImpl
expr
- Expressionscope
- Scope
public SqlNode expandOrderExpr(SqlSelect select, SqlNode orderExpr)
SqlValidator
This is made necessary by a couple of dialect 'features':
expandOrderExpr
in interface SqlValidator
expandOrderExpr
in class SqlValidatorImpl
select
- Select statement which contains ORDER BYorderExpr
- Expression in the ORDER BY clause.
public RelDataType deriveType(SqlValidatorScope scope, SqlNode operand)
deriveType
in interface SqlValidator
deriveType
in class SqlValidatorImpl
scope
- Syntactic scopeoperand
- Parse tree node
NULL
protected void validateFrom(SqlNode node, RelDataType targetRowType, SqlValidatorScope scope)
SqlValidatorImpl
validateFrom
in class SqlValidatorImpl
node
- Node in FROM clause, typically a table or derived tabletargetRowType
- Desired row type of this expression, or SqlValidatorImpl.unknownType
if not fussy. Must not be null.scope
- Scopeprotected void validateWhereClause(SqlSelect select)
validateWhereClause
in class SqlValidatorImpl
protected void validateHavingClause(SqlSelect select)
validateHavingClause
in class SqlValidatorImpl
protected void validateOver(SqlCall call, SqlValidatorScope scope)
validateOver
in class SqlValidatorImpl
protected void validateNamespace(SqlValidatorNamespace namespace)
SqlValidatorImpl
validateNamespace
in class SqlValidatorImpl
protected boolean shouldAllowOverRelation()
shouldAllowOverRelation
in class SqlValidatorImpl
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |