public abstract class AbstractSchema extends Object implements org.apache.calcite.schema.Schema, SchemaPartitionExplorer, AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
protected String |
name |
protected List<String> |
schemaPath |
| Constructor and Description |
|---|
AbstractSchema(List<String> parentSchemaPath,
String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
contentsHaveChangedSince(long lastCheck,
long now) |
CreateTableEntry |
createNewTable(String tableName,
List<String> partitionColumns)
Creates table entry using table name and list of partition columns if any.
|
CreateTableEntry |
createNewTable(String tableName,
List<String> partitionColumns,
StorageStrategy storageStrategy)
Creates table entry using table name, list of partition columns
and storage strategy used to create table folder and files
|
boolean |
createView(View view)
Create a new view given definition.
|
void |
dropTable(String tableName) |
void |
dropView(String viewName)
Drop the view with given name.
|
org.apache.calcite.schema.Schema |
getDefaultSchema()
The schema can be a top level schema which doesn't have its own tables, but refers
to one of the default sub schemas for table look up.
|
org.apache.calcite.linq4j.tree.Expression |
getExpression(org.apache.calcite.schema.SchemaPlus parentSchema,
String name) |
String |
getFullSchemaName() |
Set<String> |
getFunctionNames() |
Collection<org.apache.calcite.schema.Function> |
getFunctions(String name) |
String |
getName() |
List<String> |
getSchemaPath() |
Iterable<String> |
getSubPartitions(String table,
List<String> partitionColumns,
List<String> partitionValues)
Get a list of sub-partitions of a particular table and the partitions
specified by partition columns and values.
|
org.apache.calcite.schema.Schema |
getSubSchema(String name) |
Set<String> |
getSubSchemaNames() |
org.apache.calcite.schema.Table |
getTable(String name) |
Set<String> |
getTableNames() |
List<org.apache.commons.lang3.tuple.Pair<String,org.apache.calcite.schema.Schema.TableType>> |
getTableNamesAndTypes(boolean bulkLoad,
int bulkSize) |
List<org.apache.commons.lang3.tuple.Pair<String,? extends org.apache.calcite.schema.Table>> |
getTablesByNames(List<String> tableNames)
Get the collection of
Table tables specified in the tableNames. |
List<org.apache.commons.lang3.tuple.Pair<String,? extends org.apache.calcite.schema.Table>> |
getTablesByNamesByBulkLoad(List<String> tableNames,
int bulkSize)
Get the collection of
Table tables specified in the tableNames with bulk-load (if the underlying storage
plugin supports). |
abstract String |
getTypeName() |
boolean |
isMutable() |
boolean |
showInInformationSchema()
Reports whether to show items from this schema in INFORMATION_SCHEMA
tables.
|
public Iterable<String> getSubPartitions(String table, List<String> partitionColumns, List<String> partitionValues) throws PartitionNotFoundException
SchemaPartitionExplorerPartitionExplorer.getSubPartitions in interface SchemaPartitionExplorerpartitionColumns - a list of partitions to matchpartitionValues - list of values of each partition (corresponding
to the partition column list)PartitionNotFoundException - when the partition does not exist in
the given workspacepublic String getName()
public String getFullSchemaName()
public abstract String getTypeName()
public org.apache.calcite.schema.Schema getDefaultSchema()
public boolean createView(View view) throws IOException
view - View info including name, definition etc.IOExceptionpublic void dropView(String viewName) throws IOException
viewName - IOExceptionpublic CreateTableEntry createNewTable(String tableName, List<String> partitionColumns, StorageStrategy storageStrategy)
tableName - : new table name.partitionColumns - : list of partition columns. Empty list if there is no partition columns.storageStrategy - : storage strategy used to create table folder and filespublic CreateTableEntry createNewTable(String tableName, List<String> partitionColumns)
tableName - : new table name.partitionColumns - : list of partition columns. Empty list if there is no partition columns.public boolean showInInformationSchema()
This base implementation returns true.
public Collection<org.apache.calcite.schema.Function> getFunctions(String name)
getFunctions in interface org.apache.calcite.schema.Schemapublic Set<String> getFunctionNames()
getFunctionNames in interface org.apache.calcite.schema.Schemapublic org.apache.calcite.schema.Schema getSubSchema(String name)
getSubSchema in interface org.apache.calcite.schema.Schemapublic Set<String> getSubSchemaNames()
getSubSchemaNames in interface org.apache.calcite.schema.Schemapublic boolean isMutable()
isMutable in interface org.apache.calcite.schema.Schemapublic org.apache.calcite.schema.Table getTable(String name)
getTable in interface org.apache.calcite.schema.Schemapublic Set<String> getTableNames()
getTableNames in interface org.apache.calcite.schema.Schemapublic org.apache.calcite.linq4j.tree.Expression getExpression(org.apache.calcite.schema.SchemaPlus parentSchema,
String name)
getExpression in interface org.apache.calcite.schema.Schemapublic boolean contentsHaveChangedSince(long lastCheck,
long now)
contentsHaveChangedSince in interface org.apache.calcite.schema.Schemapublic void close()
throws Exception
close in interface AutoCloseableExceptionpublic void dropTable(String tableName)
public List<org.apache.commons.lang3.tuple.Pair<String,? extends org.apache.calcite.schema.Table>> getTablesByNamesByBulkLoad(List<String> tableNames, int bulkSize)
Table tables specified in the tableNames with bulk-load (if the underlying storage
plugin supports).
It is not guaranteed that the retrieved tables would have RowType and Statistic being fully populated.
Specifically, calling Table.getRowType(RelDataTypeFactory) or Table.getStatistic() might incur
UnsupportedOperationException being thrown.tableNames - the requested tables, specified by the table namespublic List<org.apache.commons.lang3.tuple.Pair<String,? extends org.apache.calcite.schema.Table>> getTablesByNames(List<String> tableNames)
Table tables specified in the tableNames.tableNames - the requested tables, specified by the table namesCopyright © 2017 The Apache Software Foundation. All rights reserved.