Skip to content

Add ignore delete parameter#405

Open
bugbubug wants to merge 2 commits intoStarRocks:mainfrom
bugbubug:main
Open

Add ignore delete parameter#405
bugbubug wants to merge 2 commits intoStarRocks:mainfrom
bugbubug:main

Conversation

@bugbubug
Copy link
Copy Markdown

@bugbubug bugbubug commented Dec 12, 2024

What type of PR is this:

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

Which issues of this PR fixes :

Fixes #392

Problem Summary(Required) :

This PR introduces a new parameter to control whether to ignore delete records. By default, this parameter is set to false, meaning delete records will be processed normally. However, when users choose to set it to true, the system will ignore the delete records. This feature is particularly useful in scenarios where users want to retain full data when syncing with Flink CDC, without altering the source Flink CDC message sending configuration.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr will affect users' behaviors
  • This pr needs user documentation (for new or modified features or behaviors)
  • I have added documentation for my new feature or new function

Signed-off-by: rico <bugbubug@gmail.com>
@jaogoy jaogoy requested review from banmoy and Copilot July 28, 2025 09:20
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

This PR adds a new ignore-delete parameter to the StarRocks Flink connector, allowing users to skip processing of delete records during CDC synchronization. This is particularly useful when users want to retain full data from Flink CDC without modifying the source configuration.

Key changes:

  • Added SINK_IGNORE_DELETE configuration option with default value false
  • Implemented delete record filtering logic in both sink function implementations
  • Registered the new option in the dynamic table sink factory

Reviewed Changes

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

File Description
StarRocksSinkOptions.java Adds the new SINK_IGNORE_DELETE configuration option and getter method
StarRocksDynamicTableSinkFactory.java Registers the new option as an optional configuration parameter
StarRocksDynamicSinkFunctionV2.java Implements delete record filtering logic using the new parameter
StarRocksDynamicSinkFunction.java Implements delete record filtering logic using the new parameter

(!sinkOptions.supportUpsertDelete() || sinkOptions.getIgnoreDelete())) {
return;
}
if (!sinkOptions.supportUpsertDelete() && RowKind.DELETE.equals(((RowData)value).getRowKind())) {
Copy link

Copilot AI Jul 28, 2025

Choose a reason for hiding this comment

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

This condition is redundant. The previous condition already handles the case where !sinkOptions.supportUpsertDelete() and the row kind is DELETE. This duplicate logic should be removed to avoid confusion and maintain cleaner code.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@bugbubug as copilot said, should merge these two if

(!sinkOptions.supportUpsertDelete() || sinkOptions.getIgnoreDelete())) {
return;
}
if (!sinkOptions.supportUpsertDelete() && RowKind.DELETE.equals(((RowData)value).getRowKind())) {
Copy link

Copilot AI Jul 28, 2025

Choose a reason for hiding this comment

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

This condition is redundant. The previous condition already handles the case where !sinkOptions.supportUpsertDelete() and the row kind is DELETE. This duplicate logic should be removed to avoid confusion and maintain cleaner code.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@bugbubug as copilot said, should merge these two if

Copy link
Copy Markdown
Collaborator

@banmoy banmoy left a comment

Choose a reason for hiding this comment

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

should add a test in StarRocksSinkITTest

(!sinkOptions.supportUpsertDelete() || sinkOptions.getIgnoreDelete())) {
return;
}
if (!sinkOptions.supportUpsertDelete() && RowKind.DELETE.equals(((RowData)value).getRowKind())) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@bugbubug as copilot said, should merge these two if

(!sinkOptions.supportUpsertDelete() || sinkOptions.getIgnoreDelete())) {
return;
}
if (!sinkOptions.supportUpsertDelete() && RowKind.DELETE.equals(((RowData)value).getRowKind())) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@bugbubug as copilot said, should merge these two if

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.

Add Parameter to Ignore Delete Messages in Flink StarRocks Connector (Default: false)

4 participants