Package org.apache.calcite.test.catalog
Class MockCatalogReader
java.lang.Object
org.apache.calcite.prepare.CalciteCatalogReader
org.apache.calcite.test.catalog.MockCatalogReader
- All Implemented Interfaces:
RelOptSchema,Prepare.CatalogReader,Wrapper,SqlOperatorTable,SqlValidatorCatalogReader
- Direct Known Subclasses:
MockCatalogReaderDynamic,MockCatalogReaderSimple,MustFilterMockCatalogReader
Mock implementation of
SqlValidatorCatalogReader which returns tables
"EMP", "DEPT", "BONUS", "SALGRADE" (same as Oracle's SCOTT schema).
Also two streams "ORDERS", "SHIPMENTS";
and a view "EMP_20".-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceColumn resolver.static classMock implementation ofAbstractQueryableTablewith dynamic record type.static classAlternative to MockViewTable that exercises code paths in ModifiableViewTable and ModifiableViewTableInitializerExpressionFactory.static classMock implementation ofPrepare.AbstractPreparingTablewhich holdsViewTableand delegatesMockCatalogReader.MockTable.toRel(org.apache.calcite.plan.RelOptTable.ToRelContext)call to the view.static classMock schema.static classMock implementation ofPrepare.PreparingTable.static classMock implementation ofPrepare.PreparingTablefor views.static classMock implementation ofMockCatalogReader.MockTablethat supports must-filter fields. -
Field Summary
Fields inherited from class org.apache.calcite.prepare.CalciteCatalogReader
config, nameMatcher, rootSchema, typeFactoryFields inherited from interface org.apache.calcite.prepare.Prepare.CatalogReader
THREAD_LOCAL -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMockCatalogReader(RelDataTypeFactory typeFactory, boolean caseSensitive) Creates a MockCatalogReader. -
Method Summary
Modifier and TypeMethodDescriptionabstract MockCatalogReaderinit()Initializes this catalog reader.booleanReturns an implementation ofSqlNameMatcherthat matches the case-sensitivity policy.protected voidprotected voidprotected voidregisterTablesWithRollUp(MockCatalogReader.MockSchema schema, org.apache.calcite.test.catalog.Fixture f) protected voidregisterType(List<String> names, RelProtoDataType relProtoDataType) Methods inherited from class org.apache.calcite.prepare.CalciteCatalogReader
createTypeFromProjection, field, getAllSchemaObjectNames, getConfig, getNamedType, getOperatorList, getRootSchema, getSchemaPaths, getTable, getTableForMember, getTypeFactory, lookupOperatorOverloads, matches, operatorTable, registerRules, unwrap, withSchemaPathMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.calcite.schema.Wrapper
maybeUnwrap, unwrapOrThrow
-
Constructor Details
-
MockCatalogReader
Creates a MockCatalogReader.Caller must then call
init()to populate with data; constructor is protected to encourage you to define acreatemethod in each concrete sub-class.- Parameters:
typeFactory- Type factory
-
-
Method Details
-
isCaseSensitive
public boolean isCaseSensitive()- Specified by:
isCaseSensitivein interfaceSqlValidatorCatalogReader- Overrides:
isCaseSensitivein classCalciteCatalogReader
-
nameMatcher
Description copied from interface:SqlValidatorCatalogReaderReturns an implementation ofSqlNameMatcherthat matches the case-sensitivity policy.- Specified by:
nameMatcherin interfaceSqlValidatorCatalogReader- Overrides:
nameMatcherin classCalciteCatalogReader
-
init
Initializes this catalog reader. -
registerTablesWithRollUp
protected void registerTablesWithRollUp(MockCatalogReader.MockSchema schema, org.apache.calcite.test.catalog.Fixture f) -
registerType
-
registerTable
-
registerSchema
-