private boolean isWritten(Entity readEntity) {
    for (Entity writeEntity : outputs) {
      //make sure to compare them as Entity, i.e. that it's the same table or partition, etc
      if (writeEntity.toString().equalsIgnoreCase(readEntity.toString())) {
        return true;
      }
    }
    return false;
  }
Check that {@code readEntity} is also being written.
ql/src/java/org/apache/hadoop/hive/ql/parse/RewriteSemanticAnalyzer.java