Skip to content

feat(agg): support paimon Java config aggregation.remove-record-on-delete#225

Merged
lszskye merged 1 commit intoalibaba:mainfrom
duanyyyyyyy:duanyan/add_agg_delete
Apr 16, 2026
Merged

feat(agg): support paimon Java config aggregation.remove-record-on-delete#225
lszskye merged 1 commit intoalibaba:mainfrom
duanyyyyyyy:duanyan/add_agg_delete

Conversation

@duanyyyyyyy
Copy link
Copy Markdown
Contributor

@duanyyyyyyy duanyyyyyyy commented Apr 13, 2026

Purpose

Support Java version aggregation.remove-record-on-delete config

Linked issue: close #xxx

Tests

API and Format

support aggregation.remove-record-on-delete options

Documentation

In C++ version

Status AggregateMergeFunction::Add(KeyValue&& kv) {
    if (remove_record_on_delete_ && kv.value_kind == RowKind::Delete()) {
        current_delete_row_ = true;
        row_ = std::make_unique<GenericRow>(getters_.size());
        for (size_t i = 0; i < getters_.size(); i++) {
            row_->SetField(i, getters_[i](*(kv.value)));
        }
        row_->AddDataHolder(std::move(kv.value));
        latest_kv_ = std::move(kv);
        return Status::OK();   
    }
    current_delete_row_ = false;
}

for Java

public void add(KeyValue kv) {
    latestKv = kv;
    currentDeleteRow = removeRecordOnDelete && kv.valueKind() == RowKind.DELETE;
    if (currentDeleteRow) {
        row = new GenericRow(getters.length);
        initRow(row, kv.value());
        return;            
    }
}

Generative AI tooling

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 13, 2026

CLA assistant check
All committers have signed the CLA.

@duanyyyyyyy duanyyyyyyy force-pushed the duanyan/add_agg_delete branch from 7ccaec8 to a0bb9fb Compare April 13, 2026 14:09
@lxy-9602 lxy-9602 changed the title Support paimon Java config aggregation.remove-record-on-delete feat(agg): support paimon Java config aggregation.remove-record-on-delete Apr 13, 2026
@duanyyyyyyy duanyyyyyyy force-pushed the duanyan/add_agg_delete branch from a0bb9fb to 63b738f Compare April 13, 2026 14:25
@lucasfang lucasfang requested a review from Copilot April 14, 2026 01:00
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

Adds support for the aggregation.remove-record-on-delete table option so the aggregation merge engine can output DELETE records (instead of treating them purely as retractions), aligning behavior with the Java configuration.

Changes:

  • Introduce new option constant aggregation.remove-record-on-delete and parse/store it in CoreOptions.
  • Plumb the option into AggregateMergeFunction and adjust merge/output logic to return RowKind::Delete() when applicable.
  • Add unit tests covering delete behavior with and without the new option.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/paimon/core/mergetree/compact/aggregate/aggregate_merge_function.cpp Implements delete-short-circuit behavior when the new option is enabled and outputs DELETE via GetResult().
src/paimon/core/mergetree/compact/aggregate/aggregate_merge_function.h Adds/initializes new merge-function state (remove_record_on_delete_, current_delete_row_).
src/paimon/core/mergetree/compact/aggregate/aggregate_merge_function_test.cpp Adds tests for delete handling with/without aggregation.remove-record-on-delete.
src/paimon/core/core_options.h Declares CoreOptions::AggregationRemoveRecordOnDelete().
src/paimon/core/core_options.cpp Parses and stores the new option in CoreOptions.
include/paimon/defs.h Declares the new option key in Options.
src/paimon/common/defs.cpp Defines the new option key string literal.

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

Comment thread src/paimon/core/core_options.h
@duanyyyyyyy duanyyyyyyy force-pushed the duanyan/add_agg_delete branch from 1cb1e37 to efd534e Compare April 14, 2026 05:33
@duanyyyyyyy duanyyyyyyy force-pushed the duanyan/add_agg_delete branch from c6489ac to c7d549d Compare April 16, 2026 02:45
@lszskye lszskye merged commit cfa2d6a into alibaba:main Apr 16, 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