deniskuzZ commented on code in PR #6413:
URL: https://github.com/apache/hive/pull/6413#discussion_r3379522193
##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/DynamicPartitionPruningOptimization.java:
##########
@@ -169,7 +169,12 @@ public Object process(Node nd, Stack<Node> stack,
NodeProcessorCtx procCtx, Obje
Table table = ts.getConf().getTableMetadata();
boolean nonEquiJoin = isNonEquiJoin(ctx.parent);
- if (table != null && table.isPartitionKey(column) && !nonEquiJoin) {
+ if (table != null && table.isNonNative() && !nonEquiJoin
Review Comment:
can we refactor
````
// Dynamic partition pruning only applies to equi-joins against an
actual table.
boolean prunable = table != null && !nonEquiJoin;
if (prunable && table.isNonNative()
&& table.getStorageHandler().addDynamicSplitPruningEdge(table,
ctx.parent)) {
// Non-native tables (e.g. Iceberg): the storage handler decides
whether the column is prunable.
String columnType = table.getFieldSchemaByName(column).getType();
generateEventOperatorPlan(ctx, parseContext, ts, column,
columnType, ctx.parent);
} else if (prunable && !table.hasNonNativePartitionSupport() &&
table.isPartitionKey(column)) {
// Native partitioned table.
````
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]