ChisomUma opened a new pull request, #10610:
URL: https://github.com/apache/gravitino/pull/10610

   
   1. Title: [#10603] fix(stats): Use BigIntVector for table_id in 
LancePartitionStatisticStorage
   
   ### What changes were proposed in this pull request?
   
   This PR fixes a vector type inconsistency in 
[LancePartitionStatisticStorage](cci:2://file:///Users/victory/Documents/codes/strapi_issues/gravitino/core/src/main/java/org/apache/gravitino/stats/storage/LancePartitionStatisticStorage.java:80:0-588:1)
 when updating metrics. The `table_id` Arrow column is defined as a 64-bit 
integer, but the implementation previously attempted to load it into a 
`UInt8Vector`. This PR updates the underlying logic to correctly retrieve and 
write the Long table IDs using a `BigIntVector` to match the declared schema.
   
   ### Why are the changes needed?
   
   Because of the previous inconsistency with its own Arrow schema, the 
Lance-backed partition statistics update path would incorrectly process table 
IDs and could fail at runtime when partition statistics were written, 
particularly when a table ID exceeded the 8-bit unsigned vector bounds. 
   
   Fix: #(issue)
   
   ### Does this PR introduce _any_ user-facing change?
   
   No user-facing changes were introduced.
   
   ### How was this patch tested?
   
   A new unit test case `testUpdateStatisticsWithLargeTableId` was added to 
[TestLancePartitionStatisticStorage.java](cci:7://file:///Users/victory/Documents/codes/strapi_issues/gravitino/core/src/test/java/org/apache/gravitino/stats/storage/TestLancePartitionStatisticStorage.java:0:0-0:0).
 The test mocks a scenario where `tableEntity.id()` is returned as `256L` and 
reliably verifies that the table statistics are listed and written exactly as 
expected without throwing type conversion errors.
   


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