prathik-onehouse opened a new issue, #20809: URL: https://github.com/apache/hudi/issues/20809
When the record index or a secondary index is initialized, its file group count assumes every entry takes a fixed 48 bytes (`HoodieTableMetadataUtil#RECORD_INDEX_AVERAGE_RECORD_SIZE`). The real size of an entry depends on the keys: long random keys take about 100 bytes and fill each file group to twice its target from the start, while UUID or composite keys take about 20 to 30 bytes and leave file groups half empty or less. Since the file group count can't change without rebuilding the index, a wrong count stays for the life of the index. The proposal is to estimate the entry size per table when the index is initialized: for the global record index, from the record key sizes and compression in the base file footers plus the value cost of the table's file slices; for a secondary index, by compressing a sample of its keys taken while they are counted. Keep 48 bytes as the fallback and add a config to set the size by hand. Related: #20603 -- 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]
