[core] Add standalone manifest sidecar format and utilities - #9845
Conversation
|
Suggestion:Could we use |
JingsongLi
left a comment
There was a problem hiding this comment.
- We should probably remove
maxBytes; it is always effective once the file is opened. - The row IDs, partition data, or bucket data within a block should be designed using a lightweight, compressed storage format, such as delta encoding combined with RLE. (Should be sorted too)
- Four bytes are sufficient for the magic number.
manifestNameHashis too tightly coupled; I don't think it's necessary.- Partition data should always be enabled.
Yes, I want to name it sidecar, a special format for manifest file |
|
RLE increased the sidecar size in the tested sample because nearly all row-ID endpoint deltas formed runs of length one. We therefore removed RLE and use delta encoding with varints, which reduced the sidecar size by over 50% compared with the original fixed-width encoding. |
| } | ||
|
|
||
| /** Read/write switches and optional payloads. Partition coverage is always enabled. */ | ||
| public static final class Settings { |
There was a problem hiding this comment.
Remove this class, just use arguement.
|
|
||
| /** Read/write switches and optional payloads. Partition coverage is always enabled. */ | ||
| public static final class Settings { | ||
| public final boolean write; |
| /** Read/write switches and optional payloads. Partition coverage is always enabled. */ | ||
| public static final class Settings { | ||
| public final boolean write; | ||
| public final boolean read; |
| ```text | ||
| magic : 4 bytes // ASCII PMSC | ||
| formatVersion : int // 1 | ||
| manifestLength : long |
| magic : 4 bytes // ASCII PMSC | ||
| formatVersion : int // 1 | ||
| manifestLength : long | ||
| manifestEntryCount : long // ADD + DELETE |
| formatVersion : int // 1 | ||
| manifestLength : long | ||
| manifestEntryCount : long // ADD + DELETE | ||
| avroHeaderLength : int |
| manifestEntryCount : long // ADD + DELETE | ||
| avroHeaderLength : int | ||
| avroHeader : bytes // original schema, codec and sync marker | ||
| partitionCount : int |
There was a problem hiding this comment.
var int. All need var int use var int, except too big.
| | --- | --- | --- | | ||
| | Any | `0` | Unavailable; only the encoding byte is present. | | ||
| | Partition | `1` | Count and delta/varint-compressed sorted unique dictionary IDs. | | ||
| | Row ID | `1` | Interval count, minimum, span, and delta/varint-compressed interior endpoints. | |
|
|
||
| ```text | ||
| partitionPayload | ||
| partitionIdCount : int // N > 0 |
There was a problem hiding this comment.
You can introduce a intsDeltaPayload:
- count
- deltas[]
Partition and row Id and bucket all refer to it.
|
|
||
| ```text | ||
| rowIdPayload | ||
| rangeCount : int // N > 0 |
There was a problem hiding this comment.
- minRowId
- maxRowId
- intsDeltaPayload
|
|
||
| ```text | ||
| bucketPayload | ||
| pairCount : int // N > 0 |
There was a problem hiding this comment.
- sort by bucket
- bucket intsDeltaPayload
- totalBucket intsDeltaPayload
Done |
| if bucketEncoding != 0: | ||
| bucketPayloadLength : varint | ||
| bucketPayload : bytes | ||
| checksum : 32 bytes // SHA-256 of all preceding bytes |
There was a problem hiding this comment.
I will use CRC32 to verify
|
|
||
| ```text | ||
| partitionPayload | ||
| intsDeltaPayload // N > 0 dictionary IDs, base = 0 |
There was a problem hiding this comment.
partitionPayload are ints, but row id payload are longs, I will comment it in manifest.md
| } | ||
|
|
||
| private static int readInt(ByteBuffer in) throws IOException { | ||
| long value = VarLengthIntUtils.decodeLong(in); |
There was a problem hiding this comment.
add decodeInt to VarLengthIntUtils
fdd01c5 to
e016a05
Compare
|
+1 |
Purpose
Introduce a standalone manifest sidecar format and utilities for selecting physical Avro blocks using independent partition, row-ID and bucket coverage. This provides the block-selection building block; automatic integration with table writers, scans and cleanup remains separate work.
ManifestFileMetainstead of duplicated in the sidecar.intsDeltaPayloadthrough the streamingDeltaVarintCodec. Row-ID coverage keeps fixed-widthminRowIdandmaxRowIdfollowed by sorted interior endpoints. Bucket pairs are sorted and stored as paired bucket/total-bucket sequences; totals use ZigZag deltas to preserve decreases after rescaling.Tests