T - Sub-type of table created by this factorypublic interface TableFactory<T extends Table>
Table 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.
| Modifier and Type | Method and Description |
|---|---|
T |
create(SchemaPlus schema,
String name,
Map<String,Object> operand,
RelDataType rowType)
Creates a Table.
|
T create(SchemaPlus schema, String name, Map<String,Object> operand, RelDataType rowType)
schema - Schema this table belongs toname - Name of this tableoperand - The "operand" JSON propertyrowType - Row type. Specified if the "columns" JSON property.Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.