Package org.apache.drill.exec.store.dfs
Class FileSystemSchemaFactory.FileSystemSchema
java.lang.Object
org.apache.drill.exec.store.AbstractSchema
org.apache.drill.exec.store.dfs.FileSystemSchemaFactory.FileSystemSchema
- All Implemented Interfaces:
AutoCloseable,org.apache.calcite.schema.Schema,SchemaPartitionExplorer
- Enclosing class:
FileSystemSchemaFactory
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.calcite.schema.Schema
org.apache.calcite.schema.Schema.TableType -
Field Summary
Fields inherited from class org.apache.drill.exec.store.AbstractSchema
name, SCHEMA_SEPARATOR, schemaPath -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendToStatsTable(String tableName) Create an append statistics table entry for given tableName.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 filescreateStatsTable(String tableName) Create stats table entry for given tableName.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.Collection<org.apache.calcite.schema.Function> getFunctions(String name) For the given table names returns list of acceptable table functions which are common for all Drill schemas.org.apache.calcite.schema.TablegetStatsTable(String tableName) Get the statistics table for given tableNameGet a list of sub-partitions of a particular table and the partitions specified by partition columns and values.getSubSchema(String name) org.apache.calcite.schema.TableReturns string describing schema type which shows where the schema came from.booleanbooleanReports whether to show items from this schema in INFORMATION_SCHEMA tables.Methods inherited from class org.apache.drill.exec.store.AbstractSchema
applyFunctionParameters, areTableNamesCaseSensitive, close, createNewTable, createView, dropTable, dropView, getExpression, getFullSchemaName, getFunctionParameters, getName, getSchemaPath, getTableNamesAndTypes, getTablesByNames, getType, getTypeMap, getTypeNames, getUser, modifyTable, needToImpersonateReadingData, snapshot, toString
-
Constructor Details
-
FileSystemSchema
- Throws:
IOException
-
-
Method Details
-
getSubPartitions
public Iterable<String> getSubPartitions(String table, List<String> partitionColumns, List<String> partitionValues) throws PartitionNotFoundException Description copied from interface:SchemaPartitionExplorerGet a list of sub-partitions of a particular table and the partitions specified by partition columns and values. Individual storage plugins will assign specific meaning to the parameters and return values.For more info see docs in
PartitionExplorer.- Specified by:
getSubPartitionsin interfaceSchemaPartitionExplorer- Overrides:
getSubPartitionsin classAbstractSchema- Parameters:
partitionColumns- a list of partitions to matchpartitionValues- list of values of each partition (corresponding to the partition column list)- Returns:
- list of sub-partitions, will be empty if a there is no further level of sub-partitioning below, i.e. hit a leaf partition
- Throws:
PartitionNotFoundException- when the partition does not exist in the given workspace
-
showInInformationSchema
public boolean showInInformationSchema()Description copied from class:AbstractSchemaReports whether to show items from this schema in INFORMATION_SCHEMA tables. (Controls ... TODO: Doc.: Mention what this typically controls or affects.)This base implementation returns
true.- Overrides:
showInInformationSchemain classAbstractSchema
-
getTypeName
Description copied from class:AbstractSchemaReturns string describing schema type which shows where the schema came from. Good practice here is to return json type name of storage plugin's config.- Specified by:
getTypeNamein classAbstractSchema- Returns:
- schema type name
-
getTable
- Specified by:
getTablein interfaceorg.apache.calcite.schema.Schema- Overrides:
getTablein classAbstractSchema
-
getFunctions
Description copied from class:AbstractSchemaFor the given table names returns list of acceptable table functions which are common for all Drill schemas. When overriding this method, parent functions must be included first to be evaluated first. If not included, parent functions won't be taken into account when creating table instance.- Specified by:
getFunctionsin interfaceorg.apache.calcite.schema.Schema- Overrides:
getFunctionsin classAbstractSchema- Parameters:
name- table name- Returns:
- list of table functions
-
getFunctionNames
- Specified by:
getFunctionNamesin interfaceorg.apache.calcite.schema.Schema- Overrides:
getFunctionNamesin classAbstractSchema
-
getSubSchema
- Specified by:
getSubSchemain interfaceorg.apache.calcite.schema.Schema- Overrides:
getSubSchemain classAbstractSchema
-
getSubSchemaNames
- Specified by:
getSubSchemaNamesin interfaceorg.apache.calcite.schema.Schema- Overrides:
getSubSchemaNamesin classAbstractSchema
-
getTableNames
- Specified by:
getTableNamesin interfaceorg.apache.calcite.schema.Schema- Overrides:
getTableNamesin classAbstractSchema
-
isMutable
public boolean isMutable()- Specified by:
isMutablein interfaceorg.apache.calcite.schema.Schema- Overrides:
isMutablein classAbstractSchema
-
createNewTable
public CreateTableEntry createNewTable(String tableName, List<String> partitionColumns, StorageStrategy storageStrategy) Description copied from class:AbstractSchemaCreates table entry using table name, list of partition columns and storage strategy used to create table folder and files- Overrides:
createNewTablein classAbstractSchema- Parameters:
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 files- Returns:
- create table entry
-
createStatsTable
Description copied from class:AbstractSchemaCreate stats table entry for given tableName.- Overrides:
createStatsTablein classAbstractSchema- Parameters:
tableName- table name- Returns:
- instance of create table entry
-
appendToStatsTable
Description copied from class:AbstractSchemaCreate an append statistics table entry for given tableName. If there is not existing statistics table, a new one is created.- Overrides:
appendToStatsTablein classAbstractSchema- Parameters:
tableName- table name- Returns:
- instance of create table entry
-
getStatsTable
Description copied from class:AbstractSchemaGet the statistics table for given tableName- Overrides:
getStatsTablein classAbstractSchema- Parameters:
tableName- table name- Returns:
- instance of statistics table
-
getDefaultSchema
Description copied from class:AbstractSchemaThe 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.Default implementation returns itself.
Ex. "dfs" schema refers to the tables in "default" workspace when querying for tables in "dfs" schema.
- Overrides:
getDefaultSchemain classAbstractSchema- Returns:
- Return the default schema where tables are created or retrieved from.
-