tanmayrauth opened a new pull request, #2776:
URL: https://github.com/apache/iceberg-go/pull/2776

   Part of  (https://github.com/apache/iceberg-go/issues/1929)
   
   Adds Table.WriteStatistics, which computes NDV statistics for a snapshot and 
saves them to the table.
   
   WriteStatistics(ctx, snapshotID, columns...):
   - Computes sketches using ComputeNDVs, one DataSketches Theta sketch per 
column.
   - Writes a Puffin statistics file under the table's metadata location, named 
<uuid>-<snapshot-id>.stats.
     - Each column gets its own apache-datasketches-theta-v1 blob, tagged with 
the snapshot ID, its sequence number and the column's field ID.
     - Each blob records its estimate in an ndv property, as Java does.
     - Blobs are written in field-ID order, so the output is deterministic.
   - Registers and commits the file in table metadata using 
Transaction.SetStatistics, then returns the updated table.
   
   Defaults:
   - A snapshotID of 0 means the current snapshot.
   - An empty columns list analyzes every top-level primitive column.
   - If there are no columns to analyze, the table is returned unchanged.
   
   Testing: TestWriteStatisticsEndToEnd writes statistics, reads the Puffin 
file back, and checks the blobs and the registered StatisticsFile.


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