Skip to content

Conversation

@luoyuxia
Copy link
Contributor

@luoyuxia luoyuxia commented Dec 4, 2025

Purpose

Linked issue: close #2107

Brief change log

CP from #1605 , only keep the code of supporting compacted row as change log

Tests

API and Format

Documentation

Copy link

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

This pull request adds support for using compacted row format as a change log in primary key tables. The change enables a new COMPACTED log format option alongside existing ARROW and INDEXED formats, providing a space-optimized row-oriented format that trades CPU for reduced storage.

Key changes:

  • Introduces COMPACTED as a new log format option for primary key tables with COMPACTED kv format
  • Implements compacted row encoding/decoding infrastructure with variable-length integer encoding (VLQ)
  • Refactors existing indexed log builder to extract common functionality into a shared abstract base class

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
fluss-server/src/main/java/org/apache/fluss/server/utils/TableDescriptorValidation.java Updates validation logic to allow both ARROW and COMPACTED log formats when kv format is COMPACTED
fluss-server/src/main/java/org/apache/fluss/server/kv/wal/CompactedWalBuilder.java New WAL builder implementation for COMPACTED log format with row encoding support
fluss-server/src/main/java/org/apache/fluss/server/kv/KvTablet.java Integrates CompactedWalBuilder into KV tablet for handling COMPACTED log format
fluss-common/src/main/java/org/apache/fluss/record/CompactedLogRecord.java New log record class implementing space-optimized encoding for CompactedRow format
fluss-common/src/main/java/org/apache/fluss/record/MemoryLogRecordsCompactedBuilder.java Builder for creating memory log records in COMPACTED format
fluss-common/src/main/java/org/apache/fluss/record/AbstractRowMemoryLogRecordsBuilder.java New abstract base class extracting common logic from row-based log record builders
fluss-common/src/main/java/org/apache/fluss/record/MemoryLogRecordsIndexedBuilder.java Refactored to extend AbstractRowMemoryLogRecordsBuilder, reducing code duplication
fluss-common/src/main/java/org/apache/fluss/record/LogRecordReadContext.java Adds support for creating read contexts for COMPACTED format with projection validation
fluss-common/src/main/java/org/apache/fluss/record/DefaultLogRecordBatch.java Implements iterator for reading COMPACTED log records from batches
fluss-common/src/main/java/org/apache/fluss/metadata/LogFormat.java Adds COMPACTED enum value and updates documentation
fluss-common/src/main/java/org/apache/fluss/config/ConfigOptions.java Updates configuration documentation to include COMPACTED format
fluss-common/src/test/java/org/apache/fluss/record/MemoryLogRecordsCompactedBuilderTest.java Comprehensive unit tests for CompactedBuilder including append, abort, and offset semantics
fluss-common/src/test/java/org/apache/fluss/record/CompactedLogRecordTest.java Unit tests for CompactedLogRecord serialization/deserialization
fluss-client/src/test/java/org/apache/fluss/client/table/FlussTableITCase.java Integration tests for COMPACTED log format including upsert, delete, and projection validation
fluss-client/src/test/java/org/apache/fluss/client/admin/FlussAdminITCase.java Updates test assertion to match new validation error message

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

@luoyuxia luoyuxia force-pushed the only-support-compacted-changelog-format branch from e2a522e to f60c002 Compare December 15, 2025 09:08
@luoyuxia
Copy link
Contributor Author

@polyzos Hi, I append a small commit to imrove some code. PTAL

@polyzos
Copy link
Contributor

polyzos commented Dec 15, 2025

@luoyuxia Looks good to me 👍

@luoyuxia luoyuxia merged commit 03c8602 into apache:main Dec 16, 2025
5 checks passed
@luoyuxia luoyuxia deleted the only-support-compacted-changelog-format branch December 16, 2025 03:24
vamossagar12 pushed a commit to vamossagar12/fluss that referenced this pull request Dec 20, 2025
---------

Co-authored-by: ipolyzos <ipolyzos.se@gmail.com>
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.

Kv table supports compacted row as change log

2 participants