Package org.apache.drill.exec.store.hive
Class ColumnListsCache
java.lang.Object
org.apache.drill.exec.store.hive.ColumnListsCache
The class represents "cache" for partition and table columns.
Used to reduce physical plan for Hive tables.
Only unique partition lists of columns stored in the column lists cache.
Table columns should be stored at index 0.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Checks if column list has been added before and returns position of column list.List<org.apache.hadoop.hive.metastore.api.FieldSchema>
getColumns
(int index) Returns list of columns at the specified position in fields list, or null if index is negative or greater than fields list size.List<org.apache.hadoop.hive.metastore.api.FieldSchema>
Safely retrieves Hive table columns from cache.
-
Constructor Details
-
ColumnListsCache
public ColumnListsCache(org.apache.hadoop.hive.metastore.api.Table table) -
ColumnListsCache
public ColumnListsCache()
-
-
Method Details
-
addOrGet
Checks if column list has been added before and returns position of column list. If list is unique, adds list to the fields list and returns it position. Returns -1, if equals null.- Parameters:
columns
- list of columns- Returns:
- index of or -1, if equals null
-
getColumns
Returns list of columns at the specified position in fields list, or null if index is negative or greater than fields list size.- Parameters:
index
- index of column list to return- Returns:
- list of columns at the specified position in fields list or null if index is negative or greater than fields list size
-
getTableSchemaColumns
Safely retrieves Hive table columns from cache.- Returns:
- list of table columns defined in hive
-
getFields
-