org.eigenbase.sql.validate
Interface SqlValidatorCatalogReader

All Known Implementing Classes:
DelegatingSqlValidatorCatalogReader, FarragoPreparingStmt, LucidDbPreparingStmt, MockCatalogReader, SqlToRelConverter.SchemaCatalogReader

public interface SqlValidatorCatalogReader

Supplies catalog information for SqlValidator.

This interface only provides a thin API to the underlying repository, and this is intentional. By only presenting the repository information of interest to the validator, we reduce the dependency on exact mechanism to implement the repository. It is also possible to construct mock implementations of this interface for testing purposes.

Since:
Mar 25, 2003
Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/validate/SqlValidatorCatalogReader.java#10 $
Author:
jhyde

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.
 

Method Detail

getTable

SqlValidatorTable getTable(String[] names)
Finds a table with the given name, possibly qualified.

Parameters:
names - Name of table
Returns:
named table, or null if not found

getNamedType

RelDataType getNamedType(SqlIdentifier typeName)
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.

Parameters:
typeName - Name of type
Returns:
named type, or null if not found

getAllSchemaObjectNames

List<SqlMoniker> getAllSchemaObjectNames(List<String> names)
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

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

String getSchemaName()
Returns the name of the current schema.

Returns:
name of the current schema