deniskuzZ commented on code in PR #5216:
URL: https://github.com/apache/hive/pull/5216#discussion_r1624185153


##########
ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java:
##########
@@ -1570,10 +1571,28 @@ public Set<FileSinkDesc> getAcidFileSinks() {
     return acidFileSinks;
   }
 
-  public boolean hasTransactionalInQuery() {
+  public boolean hasReadWriteAcidInQuery() {
     return transactionalInQuery;
   }
 
+  public boolean hasAcidResourcesInQuery() {
+    return hasReadWriteAcidInQuery() || getAcidDdlDesc() != null ||
+      Stream.of(getInputs(), getOutputs()).flatMap(Collection::stream)
+        .filter(entity -> entity.getType() == Entity.Type.TABLE || 
entity.getType() == Entity.Type.PARTITION)
+        .flatMap(entity -> {
+          Table tbl = entity.getTable();
+          if (tbl.isMaterializedView() && tbl.getMVMetadata() != null) {
+            return 
tbl.getMVMetadata().getSourceTables().stream().map(SourceTable::getTable);

Review Comment:
   ok, but it would have at least 1 txn table, isn't it?



-- 
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]

Reply via email to