Package org.apache.drill.exec.store.jdbc
Class CapitalizingJdbcSchema
java.lang.Object
org.apache.drill.exec.store.AbstractSchema
org.apache.drill.exec.store.jdbc.CapitalizingJdbcSchema
- All Implemented Interfaces:
AutoCloseable,org.apache.calcite.schema.Schema,SchemaPartitionExplorer
-
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
ConstructorsConstructorDescriptionCapitalizingJdbcSchema(List<String> parentSchemaPath, String name, DataSource dataSource, org.apache.calcite.sql.SqlDialect dialect, DrillJdbcConvention convention, String catalog, String schema, boolean caseSensitive) -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates if table names in schema are case sensitive.createNewTable(String tableName, List<String> partitionColumns, StorageStrategy strategy) Creates table entry using table name, list of partition columns and storage strategy used to create table folder and filesvoidThe 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.getSubSchema(String name) org.apache.calcite.schema.TableReturns string describing schema type which shows where the schema came from.booleanmodifyTable(String tableName) Returns table entry using table name to insert records into the table.Methods inherited from class org.apache.drill.exec.store.AbstractSchema
appendToStatsTable, applyFunctionParameters, close, createNewTable, createStatsTable, createView, dropView, getExpression, getFullSchemaName, getFunctionParameters, getName, getSchemaPath, getStatsTable, getSubPartitions, getTableNamesAndTypes, getTablesByNames, getType, getTypeMap, getTypeNames, getUser, needToImpersonateReadingData, showInInformationSchema, snapshot, toString
-
Constructor Details
-
CapitalizingJdbcSchema
public CapitalizingJdbcSchema(List<String> parentSchemaPath, String name, DataSource dataSource, org.apache.calcite.sql.SqlDialect dialect, DrillJdbcConvention convention, String catalog, String schema, boolean caseSensitive)
-
-
Method Details
-
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
-
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
-
createNewTable
public CreateTableEntry createNewTable(String tableName, List<String> partitionColumns, StorageStrategy strategy) 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.strategy- : storage strategy used to create table folder and files- Returns:
- create table entry
-
modifyTable
Description copied from class:AbstractSchemaReturns table entry using table name to insert records into the table.- Overrides:
modifyTablein classAbstractSchema- Parameters:
tableName- : new table name.- Returns:
- insert table entry
-
dropTable
- Overrides:
dropTablein classAbstractSchema
-
isMutable
public boolean isMutable()- Specified by:
isMutablein interfaceorg.apache.calcite.schema.Schema- Overrides:
isMutablein classAbstractSchema
-
getTable
- Specified by:
getTablein interfaceorg.apache.calcite.schema.Schema- Overrides:
getTablein classAbstractSchema
-
areTableNamesCaseSensitive
public boolean areTableNamesCaseSensitive()Description copied from class:AbstractSchemaIndicates if table names in schema are case sensitive. By default they are. If schema implementation claims its table names are case insensitive, it is responsible for making case insensitive look up by table name.- Overrides:
areTableNamesCaseSensitivein classAbstractSchema- Returns:
- true if table names are case sensitive
-
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.
-