JingsongLi commented on code in PR #9845: URL: https://github.com/apache/paimon/pull/9845#discussion_r4022167967
########## docs/docs/concepts/spec/manifest.md: ########## @@ -63,6 +63,227 @@ skip manifests before opening them. Each extra file belongs exclusively to one manifest. It is retained and cleaned up together with that manifest during snapshot, tag, or changelog deletion. +### Manifest Sidecar + +`ManifestSidecar` provides a binary sidecar for selecting complete Avro manifest blocks +using independent partition, row-ID and bucket coverage. A sidecar uses the +`<manifest-file-name>.avro.sidecar` naming convention. Readers find it through an explicit +`.avro.sidecar` reference in the manifest metadata's `_EXTRA_FILES`, without probing a +derived file name. The Avro schemas and `_VERSION` identifiers remain unchanged. + +The utility includes construction, validation, block selection and optional caching. Table +writers and scans do not yet invoke it automatically. Callers are responsible for publishing +sidecar references, managing file ownership, applying entry filters and reconciling ADD/DELETE +entries after block selection. `build` returns null without opening files when `Settings.write` +is false. Otherwise it reads the completed physical manifest and returns sidecar bytes; it does +not write or publish another file. + +`Settings` contains `write` and `read` switches for the calling writer and scan, and enables +row-ID and bucket payload generation independently. Partition generation is always enabled, +including the empty partition tuple for unpartitioned tables. Missing or invalid +metadata makes only the affected block's dimension unavailable. There is no sidecar byte budget: +construction keeps complete coverage and `read` consumes the entire file once it is opened. + +`read` returns null immediately when `Settings.read` is false, without inspecting metadata, +accessing the cache or opening files. An absent sidecar reference or an `IOException` also +returns null, allowing the caller to fall back to the manifest. If the thread is interrupted, the I/O failure is propagated as +`UncheckedIOException`. Other exceptions and errors propagate unchanged. `select` validates +supplied bytes directly and reports invalid containers with `IOException`. + +Version 1 uses the following layout. Container `int` and `long` fields are signed, fixed-width +4-byte and 8-byte big-endian integers. Encoding IDs are unsigned bytes with separate namespaces. +Payload counts and envelopes use the same fixed-width types; delta streams use the +variable-length encoding described below. + +```text +magic : 4 bytes // ASCII PMSC +formatVersion : int // 1 +manifestLength : long Review Comment: Remove this. ########## docs/docs/concepts/spec/manifest.md: ########## @@ -63,6 +63,227 @@ skip manifests before opening them. Each extra file belongs exclusively to one manifest. It is retained and cleaned up together with that manifest during snapshot, tag, or changelog deletion. +### Manifest Sidecar + +`ManifestSidecar` provides a binary sidecar for selecting complete Avro manifest blocks +using independent partition, row-ID and bucket coverage. A sidecar uses the +`<manifest-file-name>.avro.sidecar` naming convention. Readers find it through an explicit +`.avro.sidecar` reference in the manifest metadata's `_EXTRA_FILES`, without probing a +derived file name. The Avro schemas and `_VERSION` identifiers remain unchanged. + +The utility includes construction, validation, block selection and optional caching. Table +writers and scans do not yet invoke it automatically. Callers are responsible for publishing +sidecar references, managing file ownership, applying entry filters and reconciling ADD/DELETE +entries after block selection. `build` returns null without opening files when `Settings.write` +is false. Otherwise it reads the completed physical manifest and returns sidecar bytes; it does +not write or publish another file. + +`Settings` contains `write` and `read` switches for the calling writer and scan, and enables +row-ID and bucket payload generation independently. Partition generation is always enabled, +including the empty partition tuple for unpartitioned tables. Missing or invalid +metadata makes only the affected block's dimension unavailable. There is no sidecar byte budget: +construction keeps complete coverage and `read` consumes the entire file once it is opened. + +`read` returns null immediately when `Settings.read` is false, without inspecting metadata, +accessing the cache or opening files. An absent sidecar reference or an `IOException` also +returns null, allowing the caller to fall back to the manifest. If the thread is interrupted, the I/O failure is propagated as +`UncheckedIOException`. Other exceptions and errors propagate unchanged. `select` validates +supplied bytes directly and reports invalid containers with `IOException`. + +Version 1 uses the following layout. Container `int` and `long` fields are signed, fixed-width +4-byte and 8-byte big-endian integers. Encoding IDs are unsigned bytes with separate namespaces. +Payload counts and envelopes use the same fixed-width types; delta streams use the +variable-length encoding described below. + +```text +magic : 4 bytes // ASCII PMSC +formatVersion : int // 1 +manifestLength : long +manifestEntryCount : long // ADD + DELETE Review Comment: Remove this. -- 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]
