Skip to content

feat(spill): add SpillWriter, SpillReader and SpillChannelManager for…#219

Merged
zjw1111 merged 2 commits intoalibaba:mainfrom
dalingmeng:main
Apr 21, 2026
Merged

feat(spill): add SpillWriter, SpillReader and SpillChannelManager for…#219
zjw1111 merged 2 commits intoalibaba:mainfrom
dalingmeng:main

Conversation

@dalingmeng
Copy link
Copy Markdown
Contributor

Purpose

Add FileIOChannel, SpillWriter, SpillReader, SpillChannelManager classes to support spillable write buffer for PK Table
Linked issue: #149

Tests

TEST_F(SpillWriterTest, TestWriteBatch)
TEST_F(SpillReaderTest, TestReadMultipleBatches)
TEST_F(SpillChannelManagerTest.*)
TEST(IOManagerTest, CreateChannelShouldReturnValidAndUniquePaths)
TEST(IOManagerTest, CreateChannelEnumeratorShouldReturnSequentialAndUniquePaths)

API and Format

Documentation

Generative AI tooling

Generated-by: Aone Copilot(Claude-4.6-Opus)

@dalingmeng dalingmeng force-pushed the main branch 5 times, most recently from 081de6b to c738a46 Compare April 10, 2026 08:24
@zjw1111 zjw1111 requested a review from Copilot April 10, 2026 08:48
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds spill-file infrastructure to support a spillable write buffer for PK table workflows (issue #149), including channel creation/enumeration, spill file read/write, and corresponding unit tests.

Changes:

  • Introduces FileIOChannel and extends IOManager to create unique spill channels and enumerators.
  • Adds SpillWriter, SpillReader, and SpillChannelManager for writing/reading Arrow IPC spill files and tracking their lifecycles.
  • Adds unit tests and wires them into the test CMake target.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/paimon/core/mergetree/spill_writer_test.cpp New tests validating spill write + readback behavior across multiple writers/batches
src/paimon/core/mergetree/spill_writer.h Adds SpillWriter to write Arrow IPC spill files with compression and channel tracking
src/paimon/core/mergetree/spill_reader_test.cpp New tests validating multi-batch read behavior and decoded KeyValue fields
src/paimon/core/mergetree/spill_reader.h Adds SpillReader implementing KeyValueRecordReader over Arrow IPC spill files
src/paimon/core/mergetree/spill_channel_manager_test.cpp New tests for tracking, deleting, and resetting spill channels/files
src/paimon/core/mergetree/spill_channel_manager.h Adds SpillChannelManager to register and delete spill files/channels
src/paimon/core/disk/io_manager_test.cpp Adds tests for new channel creation APIs and enumerator naming/sequencing
src/paimon/core/disk/io_manager.cpp Implements new IOManager channel APIs with RNG + mutex for thread safety
src/paimon/CMakeLists.txt Registers new spill tests in the test build
include/paimon/disk/io_manager.h Extends public IOManager API with channel and enumerator creation
include/paimon/disk/file_io_channel.h Adds FileIOChannel::{ID, Enumerator} for unique spill file naming

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/paimon/core/mergetree/spill_writer.h Outdated
Comment thread include/paimon/disk/file_io_channel.h Outdated
Comment thread src/paimon/core/mergetree/spill_channel_manager.h
Comment thread src/paimon/core/mergetree/spill_writer_test.cpp Outdated
Comment thread include/paimon/disk/file_io_channel.h Outdated
Comment thread include/paimon/disk/file_io_channel.h Outdated
Comment thread src/paimon/core/disk/file_io_channel.h
Comment thread include/paimon/disk/file_io_channel.h Outdated
Comment thread include/paimon/disk/file_io_channel.h Outdated
Comment thread src/paimon/core/mergetree/spill_reader_test.cpp Outdated
Comment thread src/paimon/core/mergetree/spill_writer.h Outdated
Comment thread src/paimon/core/mergetree/spill_writer.h Outdated
Comment thread src/paimon/core/mergetree/spill_reader_writer_test.cpp
Comment thread src/paimon/core/mergetree/spill_writer.h Outdated
@dalingmeng dalingmeng force-pushed the main branch 9 times, most recently from 286a6ec to b3c6350 Compare April 15, 2026 07:26
@zjw1111 zjw1111 requested a review from Copilot April 15, 2026 07:29
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/paimon/core/mergetree/spill_reader.cpp Outdated
Comment thread src/paimon/core/mergetree/spill_writer.cpp
Comment thread src/paimon/core/mergetree/spill_writer.cpp
Comment thread src/paimon/core/mergetree/spill_channel_manager.h
Comment thread src/paimon/core/disk/io_manager_test.cpp Outdated
Comment thread src/paimon/core/mergetree/spill_reader_writer_test.cpp
Comment thread src/paimon/core/mergetree/spill_reader.cpp
Comment thread include/paimon/write_context.h Outdated
Copy link
Copy Markdown
Collaborator

@lucasfang lucasfang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@zjw1111 zjw1111 merged commit e7ffea3 into alibaba:main Apr 21, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants