org.eigenbase.sql.validate
Class AliasNamespace

java.lang.Object
  extended by org.eigenbase.sql.validate.AbstractNamespace
      extended by org.eigenbase.sql.validate.AliasNamespace
All Implemented Interfaces:
SqlValidatorNamespace

public class AliasNamespace
extends AbstractNamespace

Namespace for an AS t(c1, c2, ...) clause.

A namespace is necessary only if there is a column list, in order to re-map column names; a relation AS t clause just uses the same namespace as relation.

Since:
October 9, 2008
Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/validate/AliasNamespace.java#4 $
Author:
jhyde

Field Summary
protected  SqlCall call
           
 
Fields inherited from class org.eigenbase.sql.validate.AbstractNamespace
enclosingNode, rowType, validator
 
Constructor Summary
protected AliasNamespace(SqlValidatorImpl validator, SqlCall call, SqlNode enclosingNode)
          Creates an AliasNamespace.
 
Method Summary
 SqlNode getNode()
          Returns the parse tree node at the root of this namespace.
 String translate(String name)
          Translates a field name to the name in the underlying namespace.
protected  RelDataType validateImpl()
          Validates this scope and returns the type of the records it returns.
 
Methods inherited from class org.eigenbase.sql.validate.AbstractNamespace
fieldExists, getEnclosingNode, getMonotonicExprs, getMonotonicity, getRowType, getRowTypeSansSystemColumns, getTable, getValidator, isWrapperFor, lookupChild, makeNullable, setRowType, unwrap, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

call

protected final SqlCall call
Constructor Detail

AliasNamespace

protected AliasNamespace(SqlValidatorImpl validator,
                         SqlCall call,
                         SqlNode enclosingNode)
Creates an AliasNamespace.

Parameters:
validator - Validator
call - Call to AS operator
enclosingNode - Enclosing node
Method Detail

validateImpl

protected RelDataType validateImpl()
Description copied from class: AbstractNamespace
Validates this scope and returns the type of the records it returns. External users should call AbstractNamespace.validate(), which uses the AbstractNamespace.status field to protect against cycles.

Specified by:
validateImpl in class AbstractNamespace
Returns:
record data type, never null

getNode

public SqlNode getNode()
Description copied from interface: SqlValidatorNamespace
Returns the parse tree node at the root of this namespace.

Returns:
parse tree node

translate

public String translate(String name)
Description copied from interface: SqlValidatorNamespace
Translates a field name to the name in the underlying namespace.

Specified by:
translate in interface SqlValidatorNamespace
Overrides:
translate in class AbstractNamespace