Package org.apache.calcite.test.catalog
Class MockCatalogReaderSimple
java.lang.Object
org.apache.calcite.prepare.CalciteCatalogReader
org.apache.calcite.test.catalog.MockCatalogReader
org.apache.calcite.test.catalog.MockCatalogReaderSimple
- All Implemented Interfaces:
RelOptSchema
,Prepare.CatalogReader
,Wrapper
,SqlOperatorTable
,SqlValidatorCatalogReader
- Direct Known Subclasses:
MockCatalogReaderExtended
Simple catalog reader for testing.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.calcite.test.catalog.MockCatalogReader
MockCatalogReader.ColumnResolver, MockCatalogReader.MockDynamicTable, MockCatalogReader.MockModifiableViewRelOptTable, MockCatalogReader.MockRelViewTable, MockCatalogReader.MockSchema, MockCatalogReader.MockTable, MockCatalogReader.MockViewTable, MockCatalogReader.MustFilterMockTable
-
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
MockCatalogReaderSimple
(RelDataTypeFactory typeFactory, boolean caseSensitive) Creates a MockCatalogReader. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull MockCatalogReaderSimple
create
(RelDataTypeFactory typeFactory, boolean caseSensitive) Creates and initializes a MockCatalogReaderSimple.getNamedType
(SqlIdentifier typeName) Finds a user-defined type with the given name, possibly qualified.init()
Initializes this catalog reader.Methods inherited from class org.apache.calcite.test.catalog.MockCatalogReader
isCaseSensitive, nameMatcher, registerSchema, registerTable, registerTablesWithRollUp, registerType
Methods inherited from class org.apache.calcite.prepare.CalciteCatalogReader
createTypeFromProjection, field, getAllSchemaObjectNames, getConfig, 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
-
MockCatalogReaderSimple
Creates a MockCatalogReader.Caller must then call
init()
to populate with data; constructor is protected to encourage you to callcreate(org.apache.calcite.rel.type.RelDataTypeFactory, boolean)
.- Parameters:
typeFactory
- Type factorycaseSensitive
- case sensitivity
-
-
Method Details
-
create
public static @NonNull MockCatalogReaderSimple create(RelDataTypeFactory typeFactory, boolean caseSensitive) Creates and initializes a MockCatalogReaderSimple. -
getNamedType
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 interfaceSqlValidatorCatalogReader
- Overrides:
getNamedType
in classCalciteCatalogReader
- Parameters:
typeName
- Name of type- Returns:
- named type, or null if not found
-
init
Description copied from class:MockCatalogReader
Initializes this catalog reader.- Specified by:
init
in classMockCatalogReader
-