JingsongLi opened a new pull request, #9461:
URL: https://github.com/apache/paimon/pull/9461
## Purpose
Add a self-contained video file format for append/data-evolution tables
whose logical rows represent frames while the physical decoding unit is a
complete encoded video.
This avoids storing one MP4 payload per frame, avoids a sidecar object per
video, and leaves the existing `.blob` format unchanged.
## Design
- Add the `video-frame-field` table option for one scalar BLOB column.
- Add `.video` files with:
- a data region containing one or more complete encoded video payloads;
- embedded delta-varint indexes for physical video lengths, logical run
lengths, run-to-video references, and first frame ordinals;
- NULL and data-evolution placeholder run references.
- Add `VideoFrameDescriptor`, extending the normal BLOB descriptor with a
presentation-order frame ordinal.
- Keep rolling aligned to physical video groups so a complete video is not
split across files.
- Compact by byte-copying complete video ranges and rebuilding the embedded
indexes; compaction never decodes or re-encodes video.
- Keep `.video` packs self-contained. They never reference payloads owned by
another Paimon data file.
- Restrict the initial version to append/data-evolution tables without
primary keys, one scalar video field, and stride-one frame ordinals.
## PyPaimon
- Add `add_video` and `add_videos` for complete-video ingestion.
- Add `replace_video` for updating the video backing rows selected by a
predicate.
- Reuse the existing table update path for ordinary frame columns without
rewriting the existing `.video` file.
- Reject generic `update()` assignments to the video field and direct
callers to `replace_video()`.
- Reuse the existing scan and BLOB APIs. Video reads always return
descriptors, including data-evolution fallback and `blob-as-descriptor=false`.
- Add `VideoFrameCollator` for PyTorch DataLoader workers with a
process-local bounded decoder cache.
## Compatibility
- The ordinary `.blob` format and its readers/writers are unchanged.
- Primary-key managed BLOB storage remains separate and does not use
`.video`.
- Version 1 stores frame ordinals, not PTS or codec/container metadata.
## Tests
- Java targeted format/common/core tests: 79 passed.
- Ordinary Java BLOB format regression tests: 39 passed.
- Relevant PyPaimon video, multimodal, data-evolution, and ordinary BLOB
tests: 211 passed, 3 skipped, 51 subtests passed.
- Python compileall and `git diff --check` passed.
- PyTorch-dependent integration test collection was not available locally
because the optional `torch` dependency is not installed; the decoder/collator
unit tests pass.
--
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]