public class HiveMaterializedViewUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static com.facebook.presto.spi.MaterializedViewStatus.MaterializedDataPredicates |
differenceDataPredicates(com.facebook.presto.spi.MaterializedViewStatus.MaterializedDataPredicates baseTablePredicatesInfo,
com.facebook.presto.spi.MaterializedViewStatus.MaterializedDataPredicates viewPredicatesInfo,
Map<String,String> viewToBaseTablePredicatesKeyMap) |
static com.facebook.presto.spi.MaterializedViewStatus.MaterializedDataPredicates |
differenceDataPredicates(com.facebook.presto.spi.MaterializedViewStatus.MaterializedDataPredicates baseTablePredicatesInfo,
com.facebook.presto.spi.MaterializedViewStatus.MaterializedDataPredicates viewPredicatesInfo,
Map<String,String> viewToBaseTablePredicatesKeyMap,
Map<String,String> viewToBaseTableIndirectMap)
From given base table partitions, removes all partitions that are already used to compute
related view partitions, only returning partitions that are not reflected in Materialized View.
|
static com.facebook.presto.spi.MaterializedViewStatus.MaterializedDataPredicates |
getEmptyMaterializedViewDataPredicates() |
static com.facebook.presto.spi.MaterializedViewStatus.MaterializedDataPredicates |
getMaterializedDataPredicates(com.facebook.presto.hive.metastore.SemiTransactionalHiveMetastore metastore,
com.facebook.presto.hive.metastore.MetastoreContext metastoreContext,
com.facebook.presto.common.type.TypeManager typeManager,
com.facebook.presto.hive.metastore.Table table,
org.joda.time.DateTimeZone timeZone) |
static Map<com.facebook.presto.spi.SchemaTableName,Map<String,String>> |
getViewToBasePartitionMap(com.facebook.presto.hive.metastore.Table view,
List<com.facebook.presto.hive.metastore.Table> baseTables,
Map<String,Map<com.facebook.presto.spi.SchemaTableName,String>> viewToBaseColumnMap) |
static void |
validateMaterializedViewPartitionColumns(com.facebook.presto.hive.metastore.SemiTransactionalHiveMetastore metastore,
com.facebook.presto.hive.metastore.MetastoreContext metastoreContext,
com.facebook.presto.hive.metastore.Table viewTable,
com.facebook.presto.spi.MaterializedViewDefinition viewDefinition)
Validate the partition columns of a materialized view to ensure 1) a materialized view is partitioned; 2) it has at least one partition
directly mapped to all base tables and 3) Outer join conditions have common partitions that are partitions in the view as well
|
static Optional<Map<String,String>> |
viewToBaseTableOnOuterJoinSideIndirectMappedPartitions(com.facebook.presto.spi.MaterializedViewDefinition viewDefinition,
com.facebook.presto.hive.metastore.Table baseTable) |
public static void validateMaterializedViewPartitionColumns(com.facebook.presto.hive.metastore.SemiTransactionalHiveMetastore metastore,
com.facebook.presto.hive.metastore.MetastoreContext metastoreContext,
com.facebook.presto.hive.metastore.Table viewTable,
com.facebook.presto.spi.MaterializedViewDefinition viewDefinition)
A column is directly mapped to a base table column if it is derived directly or transitively from the base table column, by only selecting a column or an aliased column without any function or operator applied. For example, with SELECT column_b AS column_a, column_a is directly mapped to column_b. With SELECT column_b + column_c AS column_a, column_a is not directly mapped to any column.
viewToBaseColumnMap only contains direct column mappings.
public static com.facebook.presto.spi.MaterializedViewStatus.MaterializedDataPredicates getMaterializedDataPredicates(com.facebook.presto.hive.metastore.SemiTransactionalHiveMetastore metastore,
com.facebook.presto.hive.metastore.MetastoreContext metastoreContext,
com.facebook.presto.common.type.TypeManager typeManager,
com.facebook.presto.hive.metastore.Table table,
org.joda.time.DateTimeZone timeZone)
public static Optional<Map<String,String>> viewToBaseTableOnOuterJoinSideIndirectMappedPartitions(com.facebook.presto.spi.MaterializedViewDefinition viewDefinition, com.facebook.presto.hive.metastore.Table baseTable)
public static com.facebook.presto.spi.MaterializedViewStatus.MaterializedDataPredicates differenceDataPredicates(com.facebook.presto.spi.MaterializedViewStatus.MaterializedDataPredicates baseTablePredicatesInfo,
com.facebook.presto.spi.MaterializedViewStatus.MaterializedDataPredicates viewPredicatesInfo,
Map<String,String> viewToBaseTablePredicatesKeyMap)
public static com.facebook.presto.spi.MaterializedViewStatus.MaterializedDataPredicates differenceDataPredicates(com.facebook.presto.spi.MaterializedViewStatus.MaterializedDataPredicates baseTablePredicatesInfo,
com.facebook.presto.spi.MaterializedViewStatus.MaterializedDataPredicates viewPredicatesInfo,
Map<String,String> viewToBaseTablePredicatesKeyMap,
Map<String,String> viewToBaseTableIndirectMap)
baseTablePredicatesInfo - Partitions info for base tableviewPredicatesInfo - Partitions info for viewviewToBaseTablePredicatesKeyMap - Partitions mapping from view to base table. Only includes direct mapping, i.e. excludes mapping from outer joins EQ clauses.viewToBaseTableIndirectMap - Extra partitions mapping from view to base table, computed from viewToBaseTableOnOuterJoinSideIndirectMappedPartitions()public static com.facebook.presto.spi.MaterializedViewStatus.MaterializedDataPredicates getEmptyMaterializedViewDataPredicates()
public static Map<com.facebook.presto.spi.SchemaTableName,Map<String,String>> getViewToBasePartitionMap(com.facebook.presto.hive.metastore.Table view, List<com.facebook.presto.hive.metastore.Table> baseTables, Map<String,Map<com.facebook.presto.spi.SchemaTableName,String>> viewToBaseColumnMap)
Copyright © 2012–2023. All rights reserved.