public class HiveStatsUtil extends Object
Modifier and Type | Method and Description |
---|---|
static Map<String,CatalogColumnStatisticsDataBase> |
createCatalogColumnStats(List<org.apache.hadoop.hive.metastore.api.ColumnStatisticsObj> hiveColStats,
String hiveVersion)
Create a map of Flink column stats from the given Hive column stats.
|
static CatalogTableStatistics |
createCatalogTableStatistics(Map<String,String> parameters) |
static org.apache.hadoop.hive.metastore.api.ColumnStatistics |
createPartitionColumnStats(org.apache.hadoop.hive.metastore.api.Partition hivePartition,
String partName,
Map<String,CatalogColumnStatisticsDataBase> colStats,
String hiveVersion)
Create columnStatistics from the given Hive column stats of a hive partition.
|
static org.apache.hadoop.hive.metastore.api.ColumnStatistics |
createTableColumnStats(org.apache.hadoop.hive.metastore.api.Table hiveTable,
Map<String,CatalogColumnStatisticsDataBase> colStats,
String hiveVersion)
Create columnStatistics from the given Hive column stats of a hive table.
|
static Map<String,CatalogColumnStatisticsDataBase> |
getCatalogPartitionColumnStats(HiveMetastoreClientWrapper client,
HiveShim hiveShim,
org.apache.hadoop.hive.metastore.api.Table hiveTable,
String partitionName,
List<org.apache.hadoop.hive.metastore.api.FieldSchema> partitionColsSchema,
String defaultPartitionName)
Get column statistic for partition columns.
|
static int |
parsePositiveIntStat(Map<String,String> parameters,
String key) |
static long |
parsePositiveLongStat(Map<String,String> parameters,
String key) |
static boolean |
statsChanged(CatalogTableStatistics newTableStats,
Map<String,String> parameters)
Determine whether the table statistics changes.
|
static boolean |
tableStatsChanged(Map<String,String> newStats,
Map<String,String> oldStats)
Determine whether the stats change.
|
static void |
updateStats(CatalogTableStatistics newTableStats,
Map<String,String> parameters)
Update original table statistics parameters.
|
public static Map<String,CatalogColumnStatisticsDataBase> createCatalogColumnStats(@Nonnull List<org.apache.hadoop.hive.metastore.api.ColumnStatisticsObj> hiveColStats, String hiveVersion)
public static Map<String,CatalogColumnStatisticsDataBase> getCatalogPartitionColumnStats(HiveMetastoreClientWrapper client, HiveShim hiveShim, org.apache.hadoop.hive.metastore.api.Table hiveTable, String partitionName, List<org.apache.hadoop.hive.metastore.api.FieldSchema> partitionColsSchema, String defaultPartitionName)
public static CatalogTableStatistics createCatalogTableStatistics(Map<String,String> parameters)
public static boolean statsChanged(CatalogTableStatistics newTableStats, Map<String,String> parameters)
newTableStats
- new catalog table statistics.parameters
- original hive table statistics parameters.public static boolean tableStatsChanged(Map<String,String> newStats, Map<String,String> oldStats)
newStats
- the new table statistics parametersoldStats
- the old table statistics parameterspublic static org.apache.hadoop.hive.metastore.api.ColumnStatistics createTableColumnStats(org.apache.hadoop.hive.metastore.api.Table hiveTable, Map<String,CatalogColumnStatisticsDataBase> colStats, String hiveVersion)
public static org.apache.hadoop.hive.metastore.api.ColumnStatistics createPartitionColumnStats(org.apache.hadoop.hive.metastore.api.Partition hivePartition, String partName, Map<String,CatalogColumnStatisticsDataBase> colStats, String hiveVersion)
public static void updateStats(CatalogTableStatistics newTableStats, Map<String,String> parameters)
newTableStats
- new catalog table statistics.parameters
- original hive table statistics parameters.public static int parsePositiveIntStat(Map<String,String> parameters, String key)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.