s-sanjay opened a new pull request, #14236:
URL: https://github.com/apache/iceberg/pull/14236
## Summary
Fixes an issue where the `HIVE_LOCK_ENABLED` table property was not
respected during table creation. When creating a new table, the lock type now
correctly uses the table's metadata properties instead of falling back to
configuration defaults.
## Background
PR #10016 changed `lockObject()` to use `base` metadata for lock decisions
to prevent lock type changes from taking effect mid-commit. However, when
creating a new table, `base` is `null`, which caused the lock decision to fall
back to configuration defaults instead of using the table's properties.
## Changes
- **HiveTableOperations.java**: Changed the caller in `doCommit()` to pass
`base != null ? base : metadata` to `lockObject()`, ensuring new tables use
their metadata properties for lock decisions
- **TestHiveCommits.java**: Added four test cases:
- `testCreateTableWithNoLockEndToEnd`: End-to-end test for table creation
with `HIVE_LOCK_ENABLED=false`
- `testCreateTableWithLockEndToEnd`: End-to-end test for table creation
with `HIVE_LOCK_ENABLED=true`
- `testCreateTableWithNoLock`: Unit test verifying NoLock is used during
table creation with the property set to false
- `testCreateTableWithLock`: Unit test verifying MetastoreLock is used
during table creation with default/true setting
## Test plan
- Added comprehensive unit and end-to-end tests covering both NoLock and
MetastoreLock scenarios during table creation
- Existing test `testChangeLockWithAlterTable` continues to verify that lock
changes on existing tables use base metadata
--
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]