Details
Description
Consider
update acidTbl set b=19 where acidTbl.b in(select I.b from nonAcidOrcTbl I where I.a = 3)
noAcidOrcTbl doesn't get locked at all. (SHARED_WRITE is taken on acidTbl).
Same for _delete_ with subquery
This is is because the ReadEntity for nonAcidOrcTbl is skipped by
for (ReadEntity input : plan.getInputs()) { if (!input.needsLock() || input.isUpdateOrDelete()) { // We don't want to acquire readlocks during update or delete as we'll be acquiring write // locks instead. continue; }
whatever sets isUpdateOrDelete() flag doesn't pay attention to whether the table is written to or not.
HIVE-10150 was a similar issue, abstractly