org.eigenbase.sql2rel
Class SqlToRelConverter.SchemaCatalogReader

java.lang.Object
  extended by org.eigenbase.sql2rel.SqlToRelConverter.SchemaCatalogReader
All Implemented Interfaces:
SqlValidatorCatalogReader
Enclosing class:
SqlToRelConverter

public static class SqlToRelConverter.SchemaCatalogReader
extends Object
implements SqlValidatorCatalogReader

A SchemaCatalogReader looks up catalog information from a schema object.


Field Summary
private  RelOptSchema schema
           
private  boolean upperCase
           
 
Constructor Summary
SqlToRelConverter.SchemaCatalogReader(RelOptSchema schema, boolean upperCase)
           
 
Method Summary
 List<SqlMoniker> getAllSchemaObjectNames(List<String> names)
          Gets schema object names as specified.
 RelDataType getNamedType(SqlIdentifier typeName)
          Finds a user-defined type with the given name, possibly qualified.
 String getSchemaName()
          Returns the name of the current schema.
 SqlValidatorTable getTable(String[] names)
          Finds a table with the given name, possibly qualified.
private  String maybeUpper(String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

schema

private final RelOptSchema schema

upperCase

private final boolean upperCase
Constructor Detail

SqlToRelConverter.SchemaCatalogReader

public SqlToRelConverter.SchemaCatalogReader(RelOptSchema schema,
                                             boolean upperCase)
Method Detail

getTable

public SqlValidatorTable getTable(String[] names)
Description copied from interface: SqlValidatorCatalogReader
Finds a table with the given name, possibly qualified.

Specified by:
getTable in interface SqlValidatorCatalogReader
Parameters:
names - Name of table
Returns:
named table, or null if not found

getNamedType

public RelDataType getNamedType(SqlIdentifier typeName)
Description copied from interface: SqlValidatorCatalogReader
Finds a user-defined type with the given name, possibly qualified.

NOTE jvs 12-Feb-2005: the reason this method is defined here instead of on RelDataTypeFactory is that it has to take into account context-dependent information such as SQL schema path, whereas a type factory is context-independent.

Specified by:
getNamedType in interface SqlValidatorCatalogReader
Parameters:
typeName - Name of type
Returns:
named type, or null if not found

getAllSchemaObjectNames

public List<SqlMoniker> getAllSchemaObjectNames(List<String> names)
Description copied from interface: SqlValidatorCatalogReader
Gets schema object names as specified. They can be schema or table object. If names array contain 1 element, return all schema names and all table names under the default schema (if that is set) If names array contain 2 elements, treat 1st element as schema name and return all table names in this schema

Specified by:
getAllSchemaObjectNames in interface SqlValidatorCatalogReader
Parameters:
names - the array contains either 2 elements representing a partially qualified object name in the format of 'schema.object', or an unqualified name in the format of 'object'
Returns:
the list of all object (schema and table) names under the above criteria

getSchemaName

public String getSchemaName()
Description copied from interface: SqlValidatorCatalogReader
Returns the name of the current schema.

Specified by:
getSchemaName in interface SqlValidatorCatalogReader
Returns:
name of the current schema

maybeUpper

private String maybeUpper(String s)