zhangbutao commented on code in PR #6380:
URL: https://github.com/apache/hive/pull/6380#discussion_r3293047416
##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/SharedWorkOptimizer.java:
##########
@@ -646,9 +646,12 @@ protected boolean areMergeable(ParseContext pctx,
TableScanOperator tsOp1, Table
return false;
}
- // HIVE-29509: Include snapshotRef to ensure different Iceberg
branches/tags are treated as distinct tables
- if (!Objects.equals(tsOp1.getConf().getSnapshotRef(),
tsOp2.getConf().getSnapshotRef())) {
- LOG.debug("Snapshot Ref differ {} ~ {}",
tsOp1.getConf().getSnapshotRef(), tsOp2.getConf().getSnapshotRef());
+ // Time-travel qualifier (snapshotRef, asOfVersion, asOfTimestamp) must
match,
+ // otherwise the two scans address different snapshots of the same table.
Review Comment:
Should we also change here?
```
diff --git
a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/SharedWorkOptimizer.java
b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/SharedWorkOptimizer.java
index 3c01817033..c431e8f4b6 100644
---
a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/SharedWorkOptimizer.java
+++
b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/SharedWorkOptimizer.java
@@ -1864,6 +1864,7 @@ private static boolean compareOperator(ParseContext
pctx, Operator<?> op1, Opera
Table tableMeta1 = op1Conf.getTableMetadata();
Table tableMeta2 = op2Conf.getTableMetadata();
if (StringUtils.equals(tableMeta1.getFullyQualifiedName(),
tableMeta2.getFullyQualifiedName())
+ && StringUtils.equals(tableMeta1.getQualifier(),
tableMeta2.getQualifier())
&& op1Conf.getNeededColumns().equals(op2Conf.getNeededColumns())
&& StringUtils.equals(op1Conf.getFilterExprString(),
op2Conf.getFilterExprString())
&& pctx.getPrunedPartitions(tsOp1).getPartitions().equals(
```
--
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]