ayushtkn commented on code in PR #4291:
URL: https://github.com/apache/hive/pull/4291#discussion_r1235156198


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergMetaHook.java:
##########
@@ -337,6 +342,23 @@ public void 
preAlterTable(org.apache.hadoop.hive.metastore.api.Table hmsTable, E
     }
   }
 
+  @NotNull
+  private static Optional<Long> getTxnId() {
+    Optional<Long> txnId;
+    txnId = Optional.empty();
+
+    SessionState sessionState = SessionState.get();
+
+    if (sessionState != null) {
+      HiveTxnManager txnMgr = sessionState.getTxnMgr();
+      if (txnMgr != null) {
+        txnId = Optional.of(txnMgr.getCurrentTxnId());
+      }
+    }

Review Comment:
   this part is dupe in
   ```
   HiveTableOperations.java
   ```
   and this in static method, can we keep this logic at one place & use it in 
the another?



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