|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.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 mode| Method Detail |
|---|
public void validateIdentifier(SqlIdentifier id,
SqlValidatorScope scope)
validateIdentifier in interface SqlValidatorvalidateIdentifier in class SqlValidatorImplid - Identifierscope - Naming scope
private void registerId(SqlIdentifier id,
SqlValidatorScope scope)
public SqlNode expand(SqlNode expr,
SqlValidatorScope scope)
SqlValidator
expand in interface SqlValidatorexpand in class SqlValidatorImplexpr - Expressionscope - Scope
public SqlNode expandOrderExpr(SqlSelect select,
SqlNode orderExpr)
SqlValidatorThis is made necessary by a couple of dialect 'features':
expandOrderExpr in interface SqlValidatorexpandOrderExpr in class SqlValidatorImplselect - Select statement which contains ORDER BYorderExpr - Expression in the ORDER BY clause.
public RelDataType deriveType(SqlValidatorScope scope,
SqlNode operand)
deriveType in interface SqlValidatorderiveType in class SqlValidatorImplscope - Syntactic scopeoperand - Parse tree node
NULL
protected void validateFrom(SqlNode node,
RelDataType targetRowType,
SqlValidatorScope scope)
SqlValidatorImpl
validateFrom in class SqlValidatorImplnode - 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 SqlValidatorImplprotected void validateHavingClause(SqlSelect select)
validateHavingClause in class SqlValidatorImpl
protected void validateOver(SqlCall call,
SqlValidatorScope scope)
validateOver in class SqlValidatorImplprotected void validateNamespace(SqlValidatorNamespace namespace)
SqlValidatorImpl
validateNamespace in class SqlValidatorImplprotected boolean shouldAllowOverRelation()
shouldAllowOverRelation in class SqlValidatorImpl
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||