Skip to content

Commit 6cc371c

Browse files
committed
commit2
1 parent dae91dc commit 6cc371c

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,11 @@ public boolean hasNonNativePartitionSupport() {
644644
}
645645

646646
public boolean isPartitionKey(String colName) {
647-
return getPartColByName(colName) != null;
647+
List<String> partKeys = getPartitionKeys().stream().map(FieldSchema::getName).toList();
648+
if (partKeys.isEmpty()) {
649+
return false;
650+
}
651+
return partKeys.contains(colName);
648652
}
649653

650654
// TODO merge this with getBucketCols function

ql/src/java/org/apache/hadoop/hive/ql/optimizer/DynamicPartitionPruningOptimization.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx, Obje
194194
} else if (table.isNonNative() &&
195195
table.getStorageHandler().addDynamicSplitPruningEdge(table, ctx.parent)) {
196196
generateEventOperatorPlan(ctx, parseContext, ts, column,
197-
table.getCols().stream().filter(e -> e.getName().equals(column)).
197+
table.getAllCols().stream().filter(e -> e.getName().equals(column)).
198198
map(e -> e.getType()).findFirst().get(), ctx.parent);
199199
} else { // semijoin
200200
LOG.debug("Column " + column + " is not a partition column");

0 commit comments

Comments
 (0)