kevinjqliu commented on code in PR #3927:
URL: https://github.com/apache/iceberg-python/pull/3927#discussion_r3981834859


##########
pyiceberg/catalog/hive.py:
##########
@@ -506,8 +507,15 @@ def load_view(self, identifier: str | Identifier) -> View:
         raise NotImplementedError
 
     def _create_lock_request(self, database_name: str, table_name: str) -> 
LockRequest:
+        # Iceberg commits do not open a metastore transaction, so the lock is 
marked NO_TXN. Setting it explicitly
+        # also matters for Hive 2.1, which rejects a lock component left at 
the default UNSET operation type.
         lock_component: LockComponent = LockComponent(
-            level=LockLevel.TABLE, type=LockType.EXCLUSIVE, 
dbname=database_name, tablename=table_name, isTransactional=True
+            level=LockLevel.TABLE,
+            type=LockType.EXCLUSIVE,
+            dbname=database_name,
+            tablename=table_name,
+            operationType=DataOperationType.NO_TXN,

Review Comment:
   we cannot add unit test since the infra is using hive 4.x
   
   i did test this locally with a hive 2.1 setup



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