mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-11-28 13:44:03 +00:00
* feat(mito): store native histograms in Narthex samples A physical table whose single value field is the canonical greptime_native_histogram struct can now use sst_format = 'narthex'. The samples format gets column encoding 8, which lays out a block's histogram field child by child: each struct child is encoded with the nullable XOR codec of encoding 5, integers ZigZag-mapped, and a list as its nullable lengths followed by its flattened items. The chunk header names the child count and child kinds, the manifest records the field type as "native_histogram", and a block whose field chunk encoding does not match its manifest type is rejected. Writers and bulk memtable parts cut a block before a histogram chunk's size bound would pass the 1 MiB chunk limit, and a Narthex region rejects a sample that cannot fit one chunk before accepting the write. The prepared columnar reader now serves histogram fields, so native PromQL raw scans read Narthex histogram regions; float-only projections still skip histogram chunks. Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * test(mito): cover Narthex histogram bulk limits and sidecar reads Add tests for paths the histogram change relies on but no test pinned: the bulk write path refusing an oversized histogram sample before WAL and memtable, the bulk memtable splitting large histograms into blocks whose chunks stay within the samples chunk limit, and native PromQL reading histograms from a columnar series-index sidecar on a Parquet metric table, compared with the plain Parquet answer. Also wrap three long lines in the samples format doc. Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * docs(mito): state that the block size formula does not bound histogram buffers Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * fix(mito): release read-ahead before failing a histogram reservation Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * docs(mito): pin the native histogram chunk layout and child order Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * fix(mito): check bulk histogram sizes after filling missing columns Signed-off-by: Dennis Zhuang <killme2008@gmail.com> --------- Signed-off-by: Dennis Zhuang <killme2008@gmail.com>