okumin commented on code in PR #5452:
URL: https://github.com/apache/hive/pull/5452#discussion_r1814927537
##########
ql/src/java/org/apache/hadoop/hive/ql/plan/mapper/PlanMapper.java:
##########
@@ -217,7 +230,11 @@ private void link(Object o1, Object o2, boolean mayMerge) {
}
if (mGroups.size() > 1) {
if (!mayMerge) {
- throw new RuntimeException("equivalence mapping violation");
+ LOG.warn("Illegally linking {} and {}", o1, o2);
+ if (failsWithIllegalLink) {
+ throw new RuntimeException("equivalence mapping violation");
+ }
+ isBroken.set(true);
Review Comment:
Now, I understand what you said, maybe. I was convinced that it was all or
nothing, which means I thought a partially valid PlanMapper could never exist.
Your comment should be worth considering.
I'm checking the source code with my mind updated.
```
if (mGroups.size() > 1) {
if (!mayMerge) {
LOG.warn("Illegally linking {} and {}", o1, o2);
return;
}
```
I guess we should be a bit more defensive. That's because we have two places
using
[AuxOpTreeSignature](https://github.com/apache/hive/blob/454415b4798dbb7accf5e5de23db3dc4801b7d68/ql/src/java/org/apache/hadoop/hive/ql/plan/mapper/AuxOpTreeSignature.java#L76)
which [links all Operators with
mayMerge=true](https://github.com/apache/hive/blob/454415b4798dbb7accf5e5de23db3dc4801b7d68/ql/src/java/org/apache/hadoop/hive/ql/plan/mapper/PlanMapper.java#L198-L219).
It is not evident why AuxOpTreeSignature can safely relink the Operators which
have been rejected once before. It could be illegal.
```
if (mGroups.size() > 1) {
if (!mayMerge) {
LOG.warn("Illegally linking {} and {}", o1, o2);
mGroups.forEach(g -> g.add(new
OperatorStats.IncorrectRuntimeStatsMarker()));
return;
}
```
I guess this can keep the valid part alive, marking the unexpected part
invalidated and removing `PlanMapper#isBroken`. I am thinking of that approach.
--
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]