Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add new option ignore_key for debeizum format #15304

Merged
merged 8 commits into from
Mar 2, 2024

Conversation

tabVersion
Copy link
Contributor

@tabVersion tabVersion commented Feb 27, 2024

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

add a format spec option ignore_key for format DEBEZIUM. (accepts true and false, default to false)

The option controls whether to ignore the key part for given messages. If set to true, debezium format will work with only the payload part.
Note that in this case, RW cannot handle tombstone message. So users should guarantee that payload MUST NOT be empty.

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

as described above

@tabVersion tabVersion marked this pull request as ready for review February 29, 2024 07:58
Comment on lines +320 to +322
if source_schema.format == Format::Debezium {
try_consume_string_from_options(&mut format_encode_options_to_consume, DEBEZIUM_IGNORE_KEY);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@xiangjinwu I am not sure where to put this code, ignore_key seems the first format accepting options.

Comment on lines +52 to +58
pub fn from(props: &BTreeMap<String, String>) -> Self {
let ignore_key = props
.get(DEBEZIUM_IGNORE_KEY)
.map(|v| v.eq_ignore_ascii_case("true"))
.unwrap_or(false);
Self { ignore_key }
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also note that format_endcode_options are not tracked in with option checks (of course they are not in with clause).
I am wondering if we need another tool to track this options

kafka.brokers = 'message_queue:29092',
kafka.scan.startup.mode = 'earliest')
FORMAT DEBEZIUM ENCODE JSON (
ignore_key = 'true'
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to put this in the with statement? This may happen for debezium avro as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is an option for format rather than the connector, not suitable for putting it in with clause.

This may happen for debezium avro as well.

Yes, this option can also apply to debezium avro.

Copy link
Contributor

@liurenjie1024 liurenjie1024 left a comment

Choose a reason for hiding this comment

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

Generally LGTM, thanks!

Copy link
Contributor

@liurenjie1024 liurenjie1024 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@tabVersion tabVersion added this pull request to the merge queue Mar 1, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 1, 2024
@tabVersion
Copy link
Contributor Author

resolve #15156

lmatz pushed a commit that referenced this pull request Mar 7, 2024
…5460)

Signed-off-by: tabVersion <tabvision@bupt.icu>
@xiangjinwu xiangjinwu changed the title feat: add new option ignore_option for debeizum format feat: add new option ignore_key for debeizum format Apr 5, 2024
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.

2 participants