public class PartitionPruner extends Transform
| Modifier and Type | Field and Description |
|---|---|
static String |
CLASS_NAME |
static org.slf4j.Logger |
LOG |
| Constructor and Description |
|---|
PartitionPruner() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
hasColumnExpr(ExprNodeDesc desc)
Whether the expression contains a column node or not.
|
static boolean |
onlyContainsPartnCols(Table tab,
ExprNodeDesc expr)
Find out whether the condition only contains partitioned columns.
|
static PrunedPartitionList |
prune(Table tab,
ExprNodeDesc prunerExpr,
HiveConf conf,
String alias,
Map<String,PrunedPartitionList> prunedPartitionsMap)
Get the partition list for the table that satisfies the partition pruner
condition.
|
static PrunedPartitionList |
prune(TableScanOperator ts,
ParseContext parseCtx,
String alias)
Get the partition list for the TS operator that satisfies the partition pruner
condition.
|
static boolean |
prunePartitionNames(List<String> partColumnNames,
List<PrimitiveTypeInfo> partColumnTypeInfos,
ExprNodeGenericFuncDesc prunerExpr,
String defaultPartitionName,
List<String> partNames)
Prunes partition names to see if they match the prune expression.
|
ParseContext |
transform(ParseContext pctx)
All transformation steps implement this interface.
|
beginPerfLogging, endPerfLogging, endPerfLoggingpublic static final String CLASS_NAME
public static final org.slf4j.Logger LOG
public ParseContext transform(ParseContext pctx) throws SemanticException
Transformtransform in class Transformpctx - input parse contextSemanticExceptionpublic static boolean onlyContainsPartnCols(Table tab, ExprNodeDesc expr)
tab - the table objectexpr - the pruner expression for the tablepublic static PrunedPartitionList prune(TableScanOperator ts, ParseContext parseCtx, String alias) throws SemanticException
SemanticExceptionpublic static PrunedPartitionList prune(Table tab, ExprNodeDesc prunerExpr, HiveConf conf, String alias, Map<String,PrunedPartitionList> prunedPartitionsMap) throws SemanticException
tab - the table object for the aliasprunerExpr - the pruner expression for the aliasconf - for checking whether "strict" mode is on.alias - for generating error message only.prunedPartitionsMap - cached result for the tableSemanticExceptionpublic static boolean prunePartitionNames(List<String> partColumnNames, List<PrimitiveTypeInfo> partColumnTypeInfos, ExprNodeGenericFuncDesc prunerExpr, String defaultPartitionName, List<String> partNames) throws HiveException, org.apache.hadoop.hive.metastore.api.MetaException
partColumnNames - name of partition columnspartColumnTypeInfos - types of partition columnsprunerExpr - The expression to match.defaultPartitionName - name of default partitionpartNames - Partition names to filter. The list is modified in place.HiveExceptionorg.apache.hadoop.hive.metastore.api.MetaExceptionpublic static boolean hasColumnExpr(ExprNodeDesc desc)
Copyright © 2019 The Apache Software Foundation. All Rights Reserved.