Skip to content

Conversation

@Youngwb
Copy link
Contributor

@Youngwb Youngwb commented Dec 27, 2025

Why I'm doing:

#66944

What I'm doing:

This pull request introduces support for delete operations on Iceberg tables by adding a new IcebergDeleteSink class, its associated serialization logic, and comprehensive unit tests. The main focus is on enabling the planner to write position delete files to Iceberg tables, ensuring correct tuple validation and integration with the existing data sink infrastructure.

Iceberg Delete Sink Implementation:

  • Added a new IcebergDeleteSink class in fe/fe-core/src/main/java/com/starrocks/planner/IcebergDeleteSink.java to support delete operations for Iceberg tables, including tuple validation, configuration handling, and Thrift serialization.
  • Updated the TDataSinkType enum in gensrc/thrift/DataSinks.thrift to include the new ICEBERG_DELETE_SINK type for proper Thrift serialization and planner integration.

Testing and Validation:

  • Added a comprehensive test suite in fe/fe-core/src/test/java/com/starrocks/planner/IcebergDeleteSinkTest.java to verify tuple validation, Thrift serialization, and explain string output for the new sink.
    Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
    • This pr needs auto generate documentation
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 4.0
    • 3.5
    • 3.4
    • 3.3

Note

Iceberg delete sink

  • Adds IcebergDeleteSink (fe/fe-core/.../IcebergDeleteSink.java) to write Iceberg position delete files; validates tuple has _file (VARCHAR) and _pos (BIGINT), sets locations, compression, target file size, cloud config; provides explain output and Thrift serialization via TDataSinkType.ICEBERG_DELETE_SINK into TIcebergTableSink (uses data_location, file_format=parquet).

Thrift and tests

  • Extends gensrc/thrift/DataSinks.thrift with ICEBERG_DELETE_SINK.
  • Adds unit tests (IcebergDeleteSinkTest) covering tuple validation errors, Thrift serialization fields, and getExplainString().

Written by Cursor Bugbot for commit f63c4c7. This will update automatically on new commits. Configure here.

@wanpengfei-git wanpengfei-git requested a review from a team December 27, 2025 09:59
@Youngwb Youngwb changed the title [Feature] Add IcebergDeleteSink to support delete operations on Iceberg tables [Enhancement] Add IcebergDeleteSink to support delete operations on Iceberg tables Dec 27, 2025
@github-actions
Copy link

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

@github-actions
Copy link

[FE Incremental Coverage Report]

pass : 54 / 59 (91.53%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/planner/IcebergDeleteSink.java 54 59 91.53% [95, 100, 146, 151, 156]

@github-actions
Copy link

[BE Incremental Coverage Report]

pass : 0 / 0 (0%)

@alvin-celerdata
Copy link
Contributor

@cursor review

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
5.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants