Package org.apache.calcite.schema
Interface TableFactory<T extends Table>
-
- Type Parameters:
T
- Sub-type of table created by this factory
- All Known Implementing Classes:
CsvStreamTableFactory
,CsvTableFactory
,DruidTableFactory
,PigTableFactory
,PreferredAlbumsTableFactory
,PreferredGenresTableFactory
public interface TableFactory<T extends Table>
Factory forTable
objects.A table factory allows you to include custom tables in a model file. For example, here is a model that contains a custom table that generates a range of integers.
{ version: '1.0', defaultSchema: 'MATH', schemas: [ { name: 'MATH', tables: [ { name: 'INTEGERS', type: 'custom', factory: 'com.acme.IntegerTable', operand: { start: 3, end: 7, column: 'N' } } ] } ] }
Given that schema, the query
SELECT * FROM math.integers
returns
+---+ | N | +---+ | 3 | | 4 | | 5 | | 6 | +---+
A class that implements TableFactory specified in a schema must have a public default constructor.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
create(SchemaPlus schema, java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> operand, RelDataType rowType)
Creates a Table.
-
-
-
Method Detail
-
create
T create(SchemaPlus schema, java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> operand, RelDataType rowType)
Creates a Table.- Parameters:
schema
- Schema this table belongs toname
- Name of this tableoperand
- The "operand" JSON propertyrowType
- Row type. Specified if the "columns" JSON property.
-
-