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
Modifier and TypeClassDescriptionstatic interface
Column resolver.static class
Mock implementation ofAbstractQueryableTable
with dynamic record type.static class
Alternative to MockViewTable that exercises code paths in ModifiableViewTable and ModifiableViewTableInitializerExpressionFactory.static class
Mock implementation ofPrepare.AbstractPreparingTable
which holdsViewTable
and delegatesMockCatalogReader.MockTable.toRel(org.apache.calcite.plan.RelOptTable.ToRelContext)
call to the view.static class
Mock schema.static class
Mock implementation ofPrepare.PreparingTable
.static class
Mock implementation ofPrepare.PreparingTable
for views.static class
Mock implementation ofMockCatalogReader.MockTable
that supports must-filter fields. -
Field Summary
Fields inherited from class org.apache.calcite.prepare.CalciteCatalogReader
config, nameMatcher, rootSchema, typeFactory
Fields inherited from interface org.apache.calcite.prepare.Prepare.CatalogReader
THREAD_LOCAL
-
Constructor Summary
ModifierConstructorDescriptionprotected
MockCatalogReader
(RelDataTypeFactory typeFactory, boolean caseSensitive) Creates a MockCatalogReader. -
Method Summary
Modifier and TypeMethodDescriptionabstract MockCatalogReader
init()
Initializes this catalog reader.boolean
Returns an implementation ofSqlNameMatcher
that matches the case-sensitivity policy.protected void
protected void
protected void
registerTablesWithRollUp
(MockCatalogReader.MockSchema schema, org.apache.calcite.test.catalog.Fixture f) protected void
registerType
(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, withSchemaPath
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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 acreate
method in each concrete sub-class.- Parameters:
typeFactory
- Type factory
-
-
Method Details
-
isCaseSensitive
public boolean isCaseSensitive()- Specified by:
isCaseSensitive
in interfaceSqlValidatorCatalogReader
- Overrides:
isCaseSensitive
in classCalciteCatalogReader
-
nameMatcher
Description copied from interface:SqlValidatorCatalogReader
Returns an implementation ofSqlNameMatcher
that matches the case-sensitivity policy.- Specified by:
nameMatcher
in interfaceSqlValidatorCatalogReader
- Overrides:
nameMatcher
in classCalciteCatalogReader
-
init
Initializes this catalog reader. -
registerTablesWithRollUp
protected void registerTablesWithRollUp(MockCatalogReader.MockSchema schema, org.apache.calcite.test.catalog.Fixture f) -
registerType
-
registerTable
-
registerSchema
-