Repository navigation
feat(blob): read Paimon video files - #601
XiaoHongbo-Hope wants to merge 9 commits into
Conversation
Generated-by: OpenAI Codex CLI 0.172.0 (GPT-6.2 Sol)
Generated-by: OpenAI Codex CLI 0.172.0 (GPT-6.2 Sol)
There was a problem hiding this comment.
@XiaoHongbo-Hope, thanks for contribution. I left some comments for this pull request. PTAL.
| } | ||
| PAIMON_ASSIGN_OR_RAISE(int64_t magic, in.ReadValue<int64_t>()); | ||
| return kMagic == magic; | ||
| return kMagic == magic || (version == kVideoFrameVersion && kVideoFrameMagic == magic); |
There was a problem hiding this comment.
Prevent .blob writes from silently dropping frame identity. BlobFormatWriter::OpenBlobInputStream() uses this predicate to decide whether to dereference a value. I appended descriptors for frames 7 and 8 of the same payload to a video-frame-field table through FileStoreWrite. The commit succeeded with a .blob file, and both rows came back as ordinary blobs with FrameIndex() == -1. The append path selects the ordinary blob writer before the read-only video format can reject the write. Please reject frame descriptors at that writer boundary and guard writes to configured video fields until a frame-preserving writer is available.
| std::string uri_; | ||
| int64_t offset_ = 0; | ||
| int64_t length_ = -1; | ||
| int64_t frame_index_ = -1; |
There was a problem hiding this comment.
Treat the BlobDescriptor layout change as a public ABI change. On arm64, the exported type grows from 48 to 72 bytes. Its public implicit copy constructor lets a client compiled with the previous header place a copy in 48 bytes of client-owned storage. The updated Serialize() can then read frame_index_ beyond that storage. Please preserve the old layout by keeping video state in a separate representation, or mark this change as breaking and document that existing clients must rebuild.
| {4, 0, 9}}; | ||
| std::vector<uint32_t> sizes; | ||
| for (const auto& values : indexes) { | ||
| const auto bytes = DeltaVarintCompressor::Compress(values); |
There was a problem hiding this comment.
Add an independent Java fixture and exercise it through TableRead. The fixture here uses the C++ Delta-Varint encoder, and the tests open the format reader directly. A wire-format mistake shared by the test and reader could pass, and the table-level wiring for grouping and placeholder fallback is currently untested. The Java video-v1-moov.hex and video-frame-descriptor-v1.hex fixtures can cover both directions of the descriptor round trip. Please also cover a managed split with Parquet and overlapping .video layers, including a placeholder that falls through to an older frame, an explicit NULL, and _ROW_ID projection. Java fixtures and format change
| Reading Video Columns | ||
| --------------------- | ||
|
|
||
| Paimon C++ can read scalar BLOB columns stored in Paimon v1 ``.video`` files. |
There was a problem hiding this comment.
Document the supported six-index layout and the reimport requirement. Apache Paimon reused version 1 when it replaced the five-index footer with the 29-byte, six-index footer. Users with files written before that change need to reimport them before using this reader. Please also state explicitly that .video columns emit frame descriptors even when blob-as-descriptor=false. Upstream layout change
Generated-by: OpenAI Codex CLI 0.172.0 (GPT-6.2 Sol)
Generated-by: OpenAI Codex CLI 0.172.0 (GPT-6.2 Sol)
Generated-by: OpenAI Codex CLI 0.172.0 (GPT-6.2 Sol)
Generated-by: OpenAI Codex CLI 0.172.0 (GPT-6.2 Sol)
Generated-by: OpenAI Codex CLI 0.172.0 (GPT-6.2 Sol)
Generated-by: OpenAI Codex CLI 0.172.0 (GPT-6.2 Sol)
Purpose
Linked issue: none.
Read scalar BLOB columns stored in Paimon
.videofiles using the six-index footer written by the Java Paimon writer. Map selected table rows to lazy frame descriptors and use the BLOB fallback path for placeholders in partial updates. Java format changeTests
Cover sparse and empty selections, Arrow batch lifetime, and malformed footers and MP4 metadata. Check the descriptor encoding and decoding against fixtures from Java Paimon. Exercise overlapping video layers through
TableReadwith placeholder fallback, explicit NULL, and_ROW_IDprojection. Cover rejection of frame descriptors in the ordinary BLOB writer and writes to configured video fields.API and Format
Blob::FromDescriptor()opens the Java-compatible frame descriptor and exposes its frame ordinal and optional MP4moovrange. The frame metadata uses an internal type, preserving the publicBlobDescriptorlayout and its serialization. Video reads emit frame descriptors even whenblob-as-descriptor=false.Documentation
Document how to access the encoded payload, the supported 29-byte footer, and the need to reimport files with the earlier five-index footer.
Generative AI tooling
Generated-by: OpenAI Codex CLI 0.172.0 (GPT-6.2 Sol)