public class BasicTablesRequests extends Object
TableMetadataUnit
class.Modifier and Type | Class and Description |
---|---|
static class |
BasicTablesRequests.RequestMetadata
Request metadata holder that provides request metadata types, filters and columns.
|
Constructor and Description |
---|
BasicTablesRequests(Tables tables) |
Modifier and Type | Method and Description |
---|---|
FileMetadata |
fileMetadata(TableInfo tableInfo,
String metadataKey,
String path)
Returns file metadata based on given table information, metadata key and full path.
|
Map<String,Long> |
filesLastModifiedTime(TableInfo tableInfo,
String metadataKey,
List<String> locations)
Returns map of file full paths and their last modified time.
|
List<FileMetadata> |
filesMetadata(TableInfo tableInfo,
List<MetadataInfo> metadataInfos)
Returns files metadata based on the given table information and metadata keys.
|
List<FileMetadata> |
filesMetadata(TableInfo tableInfo,
String metadataKey,
List<String> paths)
Returns files metadata based on given table information, metadata key and files paths.
|
BasicTablesTransformer.MetadataHolder |
fullSegmentsMetadataWithoutPartitions(TableInfo tableInfo,
List<String> metadataKeys,
List<String> locations)
Returns metadata for segments, files and row groups based on given metadata keys and locations.
|
boolean |
hasMetastoreTableInfoChanged(MetastoreTableInfo metastoreTableInfo)
Checks if given metastore table information is the same with current one.
|
TableMetadataUnit |
interestingColumnsAndPartitionKeys(TableInfo tableInfo)
Returns tables interesting columns and partition keys based on given table information.
|
List<TableMetadataUnit> |
metadata(TableInfo tableInfo,
Collection<MetadataInfo> metadataInfos)
Returns list of
TableMetadataUnit metadata based on the given table information, and metadata identifiers. |
MetastoreTableInfo |
metastoreTableInfo(TableInfo tableInfo)
Returns metastore table information, including metastore version and table last modified time.
|
List<PartitionMetadata> |
partitionsMetadata(TableInfo tableInfo,
List<String> metadataKeys,
String column)
Returns partitions metadata based on given table information, metadata keys and column name.
|
List<TableMetadataUnit> |
request(BasicTablesRequests.RequestMetadata requestMetadata)
Executes Metastore Tables read request based on given information in
BasicTablesRequests.RequestMetadata . |
List<RowGroupMetadata> |
rowGroupsMetadata(TableInfo tableInfo,
List<MetadataInfo> metadataInfos)
Returns row groups metadata based on given table information and metadata identifiers.
|
List<RowGroupMetadata> |
rowGroupsMetadata(TableInfo tableInfo,
List<String> metadataKeys,
List<String> paths)
Returns row groups metadata based on the given table information, metadata keys and locations.
|
List<RowGroupMetadata> |
rowGroupsMetadata(TableInfo tableInfo,
String metadataKey,
String path)
Returns row groups metadata based on given table information, metadata key and location.
|
Map<String,Long> |
segmentsLastModifiedTime(TableInfo tableInfo,
List<String> locations)
Returns map of segments metadata keys and their last modified time.
|
List<SegmentMetadata> |
segmentsMetadata(TableInfo tableInfo,
List<MetadataInfo> metadataInfos)
Returns segments metadata based on the given table information and metadata identifiers.
|
List<SegmentMetadata> |
segmentsMetadataByColumn(TableInfo tableInfo,
List<String> locations,
String column)
Returns segments metadata based on given table information, locations and column name.
|
List<SegmentMetadata> |
segmentsMetadataByMetadataKey(TableInfo tableInfo,
List<String> locations,
String metadataKey)
Returns segments metadata based on given table information, locations and column name.
|
BaseTableMetadata |
tableMetadata(TableInfo tableInfo)
Returns table general information metadata based on given table information.
|
List<BaseTableMetadata> |
tablesMetadata(FilterExpression filter)
Returns tables general information metadata based on given filter.
|
public BasicTablesRequests(Tables tables)
public MetastoreTableInfo metastoreTableInfo(TableInfo tableInfo)
select lastModifiedTime from METASTORE where storage = 'dfs' and workspace = 'tmp' and tableName = 'nation' and metadataKey = 'GENERAL_INFO' and metadataType = 'TABLE'
tableInfo
- table informationMetastoreTableInfo
instancepublic boolean hasMetastoreTableInfoChanged(MetastoreTableInfo metastoreTableInfo)
metastoreTableInfo
- metastore table informationpublic List<BaseTableMetadata> tablesMetadata(FilterExpression filter)
select [$TABLE_METADATA$] from METASTORE where storage = 'dfs' and workspace = 'tmp' and metadataKey = 'GENERAL_INFO' and metadataType = 'TABLE'
filter
- filter expressionpublic BaseTableMetadata tableMetadata(TableInfo tableInfo)
select [$TABLE_METADATA$] from METASTORE where storage = 'dfs' and workspace = 'tmp' and tableName = 'nation' and metadataKey = 'GENERAL_INFO' and metadataType = 'TABLE'
tableInfo
- table informationpublic List<SegmentMetadata> segmentsMetadataByMetadataKey(TableInfo tableInfo, List<String> locations, String metadataKey)
select [$SEGMENT_METADATA$] from METASTORE where storage = 'dfs' and workspace = 'tmp' and tableName = 'nation' and location in ('.../part_int=3/d3', '.../part_int=3/d4') and metadataKey = 'part_int=3' and metadataType = 'SEGMENT'
tableInfo
- table informationlocations
- segments locationsmetadataKey
- metadata keypublic List<SegmentMetadata> segmentsMetadataByColumn(TableInfo tableInfo, List<String> locations, String column)
select [$SEGMENT_METADATA$] from METASTORE where storage = 'dfs' and workspace = 'tmp' and tableName = 'nation' and location in ('.../dir0', '.../dir1') and column = 'n_nation' and metadataType = 'SEGMENT'
tableInfo
- table informationlocations
- segments locationscolumn
- column namepublic List<SegmentMetadata> segmentsMetadata(TableInfo tableInfo, List<MetadataInfo> metadataInfos)
select [$SEGMENT_METADATA$] from METASTORE where storage = 'dfs' and workspace = 'tmp' and tableName = 'nation' and identifier in ('part_int=3', …) and metadataType = 'SEGMENT'
tableInfo
- table informationmetadataInfos
- list of MetadataInfo for required segments to obtainpublic List<TableMetadataUnit> metadata(TableInfo tableInfo, Collection<MetadataInfo> metadataInfos)
TableMetadataUnit
metadata based on the given table information, and metadata identifiers.
Schematic SQL request:
select * from METASTORE where storage = 'dfs' and workspace = 'tmp' and tableName = 'nation' and identifier in ('part_int=3', …) and metadataType in ('SEGMENT', …)
tableInfo
- table informationmetadataInfos
- list of MetadataInfo for required metadata to obtainpublic List<PartitionMetadata> partitionsMetadata(TableInfo tableInfo, List<String> metadataKeys, String column)
select [$PARTITION_METADATA$] from METASTORE where storage = 'dfs' and workspace = 'tmp' and tableName = 'nation' and metadataKey in ('part_int=3', 'part_int=4') and column = 'n_nation' and metadataType = 'PARTITION'
tableInfo
- table informationmetadataKeys
- list of metadata keyscolumn
- partition columnpublic List<FileMetadata> filesMetadata(TableInfo tableInfo, String metadataKey, List<String> paths)
select [$FILE_METADATA$] from METASTORE where storage = 'dfs' and workspace = 'tmp' and tableName = 'nation' and metadataKey = 'part_int=3' and path in ('/tmp/nation/part_int=3/part_varchar=g/0_0_0.parquet', …) and metadataType = 'FILE'
tableInfo
- table informationmetadataKey
- metadata keypaths
- list of full file pathspublic List<FileMetadata> filesMetadata(TableInfo tableInfo, List<MetadataInfo> metadataInfos)
select [$FILE_METADATA$] from METASTORE where storage = 'dfs' and workspace = 'tmp' and tableName = 'nation' and identifier = in ('part_int=3', …) and metadataType = 'FILE'
tableInfo
- table informationmetadataInfos
- list of MetadataInfo for required row groups to obtainpublic FileMetadata fileMetadata(TableInfo tableInfo, String metadataKey, String path)
select [$FILE_METADATA$] from METASTORE where storage = 'dfs' and workspace = 'tmp' and tableName = 'nation' and metadataKey = 'part_int=3' and path = '/tmp/nation/part_int=3/part_varchar=g/0_0_0.parquet' and metadataType = 'FILE'
tableInfo
- table informationmetadataKey
- metadata keypath
- full file pathpublic List<RowGroupMetadata> rowGroupsMetadata(TableInfo tableInfo, String metadataKey, String path)
select [$ROW_GROUP_METADATA$] from METASTORE where storage = 'dfs' and workspace = 'tmp' and tableName = 'nation' and metadataKey = 'part_int=3' and path = '/tmp/nation/part_int=3/part_varchar=g/0_0_0.parquet' and metadataType = 'ROW_GROUP'
tableInfo
- table informationmetadataKey
- metadata keypath
- full path to the file of the row grouppublic List<RowGroupMetadata> rowGroupsMetadata(TableInfo tableInfo, List<String> metadataKeys, List<String> paths)
select [$ROW_GROUP_METADATA$] from METASTORE where storage = 'dfs' and workspace = 'tmp' and tableName = 'nation' and metadataKey in ('part_int=3', …) and path in ('/tmp/nation/part_int=3/part_varchar=g/0_0_0.parquet', …) and metadataType = 'ROW_GROUP'
tableInfo
- table informationmetadataKeys
- metadata keypaths
- list of full paths to the file of the row grouppublic List<RowGroupMetadata> rowGroupsMetadata(TableInfo tableInfo, List<MetadataInfo> metadataInfos)
select [$ROW_GROUP_METADATA$] from METASTORE where storage = 'dfs' and workspace = 'tmp' and tableName = 'nation' and identifier in ('part_int=3', …) and metadataType = 'ROW_GROUP'
tableInfo
- table informationmetadataInfos
- list of MetadataInfo for required row groups to obtainpublic BasicTablesTransformer.MetadataHolder fullSegmentsMetadataWithoutPartitions(TableInfo tableInfo, List<String> metadataKeys, List<String> locations)
select [$SEGMENT_METADATA$] / [$FILE_METADATA$] / [$ROW_GROUP_METADATA$] from METASTORE where storage = 'dfs' and workspace = 'tmp' and tableName = 'nation' and metadataKey in ('part_int=1', 'part_int=2', 'part_int=5') and location in ('.../dir0/d3', '.../dir0/d4', '.../part_int=3/d3', '.../part_int=4/d4') and metadataType in ('SEGMENT', 'FILE', 'ROW_GROUP')
tableInfo
- table informationmetadataKeys
- metadata keyslocations
- locationsBasicTablesTransformer.MetadataHolder
instancepublic Map<String,Long> filesLastModifiedTime(TableInfo tableInfo, String metadataKey, List<String> locations)
select path, lastModifiedTime from METASTORE where storage = 'dfs' and workspace = 'tmp' and tableName = 'nation' and metadataKey = 'part_int=3' and location in ('/tmp/nation/part_int=3/part_varchar=g', ...) and metadataType = 'FILE'
tableInfo
- table informationmetadataKey
- metadata keylocations
- files locationspublic Map<String,Long> segmentsLastModifiedTime(TableInfo tableInfo, List<String> locations)
select metadataKey, lastModifiedTime from METASTORE where storage = 'dfs' and workspace = 'tmp' and tableName = 'nation' and location in ('.../dir0', '.../dir1') and metadataType = 'SEGMENT'
tableInfo
- table informationlocations
- segments locationspublic TableMetadataUnit interestingColumnsAndPartitionKeys(TableInfo tableInfo)
select interestingColumns, partitionKeys from METASTORE where storage = 'dfs' and workspace = 'tmp' and tableName = 'nation' and metadataKey = 'GENERAL_INFO' and metadataType = 'TABLE'
tableInfo
- table informationTableMetadataUnit
instance with set interesting columns and partition keys if presentpublic List<TableMetadataUnit> request(BasicTablesRequests.RequestMetadata requestMetadata)
BasicTablesRequests.RequestMetadata
.requestMetadata
- request metadataCopyright © 1970 The Apache Software Foundation. All rights reserved.