org.eigenbase.test
Class SqlToRelTestBase.MockRelOptSchema

java.lang.Object
  extended by org.eigenbase.test.SqlToRelTestBase.MockRelOptSchema
All Implemented Interfaces:
RelOptSchema, RelOptSchemaWithSampling
Enclosing class:
SqlToRelTestBase

protected static class SqlToRelTestBase.MockRelOptSchema
extends Object
implements RelOptSchemaWithSampling

Mock implementation of RelOptSchema.


Nested Class Summary
protected  class SqlToRelTestBase.MockRelOptSchema.MockColumnSet
           
 
Field Summary
private  SqlValidatorCatalogReader catalogReader
           
private  RelDataTypeFactory typeFactory
           
 
Constructor Summary
SqlToRelTestBase.MockRelOptSchema(SqlValidatorCatalogReader catalogReader, RelDataTypeFactory typeFactory)
           
 
Method Summary
protected  SqlToRelTestBase.MockRelOptSchema.MockColumnSet createColumnSet(SqlValidatorTable table, String[] names, RelDataType rowType, List<RelCollation> collationList)
           
 RelOptTable getTableForMember(String[] names)
          Retrieves a RelOptTable based upon a member access.
 RelOptTable getTableForMember(String[] names, String datasetName, boolean[] usedDataset)
          Retrieves a RelOptTable based upon a member access, using a sample dataset if it exists.
 RelDataTypeFactory getTypeFactory()
          Returns the type factory used to generate types for this schema.
 void registerRules(RelOptPlanner planner)
          Registers all of the rules supported by this schema.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

catalogReader

private final SqlValidatorCatalogReader catalogReader

typeFactory

private final RelDataTypeFactory typeFactory
Constructor Detail

SqlToRelTestBase.MockRelOptSchema

public SqlToRelTestBase.MockRelOptSchema(SqlValidatorCatalogReader catalogReader,
                                         RelDataTypeFactory typeFactory)
Method Detail

getTableForMember

public RelOptTable getTableForMember(String[] names)
Description copied from interface: RelOptSchema
Retrieves a RelOptTable based upon a member access.

For example, the Saffron expression salesSchema.emps would be resolved using a call to salesSchema.getTableForMember(new String[]{"emps" }).

Note that name.length is only greater than 1 for queries originating from JDBC.

Specified by:
getTableForMember in interface RelOptSchema

getTableForMember

public RelOptTable getTableForMember(String[] names,
                                     String datasetName,
                                     boolean[] usedDataset)
Description copied from interface: RelOptSchemaWithSampling
Retrieves a RelOptTable based upon a member access, using a sample dataset if it exists.

Specified by:
getTableForMember in interface RelOptSchemaWithSampling
Parameters:
names - Compound name of table
datasetName - Name of sample dataset to substitute, if it exists; null to not look for a sample
usedDataset - Output parameter which is set to true if a sample dataset is found; may be null
Returns:
Table, or null if not found

createColumnSet

protected SqlToRelTestBase.MockRelOptSchema.MockColumnSet createColumnSet(SqlValidatorTable table,
                                                                          String[] names,
                                                                          RelDataType rowType,
                                                                          List<RelCollation> collationList)

getTypeFactory

public RelDataTypeFactory getTypeFactory()
Description copied from interface: RelOptSchema
Returns the type factory used to generate types for this schema.

Specified by:
getTypeFactory in interface RelOptSchema

registerRules

public void registerRules(RelOptPlanner planner)
                   throws Exception
Description copied from interface: RelOptSchema
Registers all of the rules supported by this schema. Only called by RelOptPlanner.registerSchema(org.eigenbase.relopt.RelOptSchema).

Specified by:
registerRules in interface RelOptSchema
Throws:
Exception