Takch02 opened a new pull request, #4137:
URL: https://github.com/apache/amoro/pull/4137

   Motivation
   
   Currently, TestRewriteFiles and TestOverwriteFiles only verify the behavior 
of partitioned tables, expecting a CannotAlterHiveLocationException when 
partial rewrites or overwrites attempt to reference multiple directories. 
Non-partitioned tables, however, are not bound by Hive's strict 
1-partition-1-folder constraint and should successfully commit these 
operations. This PR adds the missing coverage for non-partitioned tables.
   
   
   Key Changes
   
   Added NonPartitioned methods in TestRewriteFiles and TestOverwriteFiles 
using Assume.assumeFalse(isPartitionedTable()).
   
   Verified successful commits instead of expecting exceptions, as 
non-partitioned tables gracefully handle files across multiple directories.
   
   Introduced Dynamic Assertions: Replaced hardcoded integer values with 
dynamic size assertions to prevent fragile tests. This ensures the tests remain 
robust regardless of table properties (e.g., Primary Key bucketing or target 
file size limits).
   
   Comprehensive State Verification: Implemented a two-step verification 
process for each test:
   
   Action Verification: Checked the exact number of files added in the latest 
transaction using lastedAddedFiles().
   
   State Verification: Checked the total number of live files in the current 
snapshot using baseStore.newScan().planFiles().
   
   
   Example of Verification Logic:
   
   Rewrite: Verified afterFiles.size() and totalLiveFiles against 
addFiles.size().
   
   Overwrite: Verified afterFiles.size() against secondDataFiles.size(), and 
totalLiveFiles against firstDataFiles.size() + secondDataFiles.size().


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

Reply via email to