|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.sql.validate.AbstractNamespace
abstract class AbstractNamespace
Abstract implementation of SqlValidatorNamespace
.
Field Summary | |
---|---|
protected SqlNode |
enclosingNode
|
private boolean |
forceNullable
|
protected RelDataType |
rowType
Type of the output row, which comprises the name and type of each output column. |
private SqlValidatorImpl.Status |
status
Whether this scope is currently being validated. |
protected SqlValidatorImpl |
validator
|
Constructor Summary | |
---|---|
AbstractNamespace(SqlValidatorImpl validator,
SqlNode enclosingNode)
Creates an AbstractNamespace. |
Method Summary | ||
---|---|---|
boolean |
fieldExists(String name)
Returns whether this namespace has a field of a given name. |
|
SqlNode |
getEnclosingNode()
Returns the parse tree node that at is at the root of this namespace and includes all decorations. |
|
List<Pair<SqlNode,SqlMonotonicity>> |
getMonotonicExprs()
Returns a list of expressions which are monotonic in this namespace. |
|
SqlMonotonicity |
getMonotonicity(String columnName)
Returns whether and how a given column is sorted. |
|
RelDataType |
getRowType()
Returns the row type of this namespace, which comprises a list of names and types of the output columns. |
|
RelDataType |
getRowTypeSansSystemColumns()
Returns the row type of this namespace, sans any system columns. |
|
SqlValidatorTable |
getTable()
Returns the underlying table, or null if there is none. |
|
SqlValidator |
getValidator()
Returns the validator. |
|
boolean |
isWrapperFor(Class<?> clazz)
Returns whether this namespace implements a given interface, or wraps a class which does. |
|
SqlValidatorNamespace |
lookupChild(String name)
Looks up a child namespace of a given name. |
|
void |
makeNullable()
Makes all fields in this namespace nullable (typically because it is on the outer side of an outer join. |
|
void |
setRowType(RelDataType rowType)
Allows RowType for the namespace to be explicitly set. |
|
String |
translate(String name)
Translates a field name to the name in the underlying namespace. |
|
|
unwrap(Class<T> clazz)
Returns this namespace, or a wrapped namespace, cast to a particular class. |
|
void |
validate()
Validates this namespace. |
|
protected abstract RelDataType |
validateImpl()
Validates this scope and returns the type of the records it returns. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eigenbase.sql.validate.SqlValidatorNamespace |
---|
getNode |
Field Detail |
---|
protected final SqlValidatorImpl validator
private SqlValidatorImpl.Status status
protected RelDataType rowType
private boolean forceNullable
protected final SqlNode enclosingNode
Constructor Detail |
---|
AbstractNamespace(SqlValidatorImpl validator, SqlNode enclosingNode)
validator
- ValidatorenclosingNode
- Enclosing nodeMethod Detail |
---|
public SqlValidator getValidator()
SqlValidatorNamespace
getValidator
in interface SqlValidatorNamespace
public final void validate()
SqlValidatorNamespace
If the scope has already been validated, does nothing.
Please call SqlValidatorImpl.validateNamespace(org.eigenbase.sql.validate.SqlValidatorNamespace)
rather than
calling this method directly.
validate
in interface SqlValidatorNamespace
protected abstract RelDataType validateImpl()
validate()
, which uses the status
field to protect against cycles.
public RelDataType getRowType()
SqlValidatorNamespace
getRowType
in interface SqlValidatorNamespace
public RelDataType getRowTypeSansSystemColumns()
SqlValidatorNamespace
getRowTypeSansSystemColumns
in interface SqlValidatorNamespace
public void setRowType(RelDataType rowType)
SqlValidatorNamespace
setRowType
in interface SqlValidatorNamespace
public SqlNode getEnclosingNode()
SqlValidatorNamespace
SqlValidatorNamespace.getNode()
.
getEnclosingNode
in interface SqlValidatorNamespace
public SqlValidatorTable getTable()
SqlValidatorNamespace
getTable
in interface SqlValidatorNamespace
public SqlValidatorNamespace lookupChild(String name)
SqlValidatorNamespace
For example, in the query select e.name from emps as e
,
e
is an IdentifierNamespace
which has a child
name
which is a FieldNamespace
.
lookupChild
in interface SqlValidatorNamespace
name
- Name of namespace
public boolean fieldExists(String name)
SqlValidatorNamespace
fieldExists
in interface SqlValidatorNamespace
name
- Field name
public List<Pair<SqlNode,SqlMonotonicity>> getMonotonicExprs()
SqlValidatorNamespace
SqlIdentifier
called "TIMESTAMP".
getMonotonicExprs
in interface SqlValidatorNamespace
public SqlMonotonicity getMonotonicity(String columnName)
SqlValidatorNamespace
getMonotonicity
in interface SqlValidatorNamespace
public void makeNullable()
SqlValidatorNamespace
makeNullable
in interface SqlValidatorNamespace
public String translate(String name)
SqlValidatorNamespace
translate
in interface SqlValidatorNamespace
public <T> T unwrap(Class<T> clazz)
SqlValidatorNamespace
unwrap
in interface SqlValidatorNamespace
clazz
- Desired type
public boolean isWrapperFor(Class<?> clazz)
SqlValidatorNamespace
isWrapperFor
in interface SqlValidatorNamespace
clazz
- Interface
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |