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(sink): support columns subset for cassandra and doris sink #16821

Merged
merged 7 commits into from
Jun 18, 2024

Conversation

xxhZs
Copy link
Contributor

@xxhZs xxhZs commented May 20, 2024

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

What's changed and what's your intention?

Fixes #16633

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

we can add partial_columns in doris sink with option.
like
create sink with(doris.partial_columns = 'true')
https://doris.apache.org/zh-CN/docs/2.0/data-operate/update/update-of-unique-model/

@xxhZs xxhZs changed the title feat(sink): support partial_update for cassandra and doris sink feat(sink): support columns subset for cassandra and doris sink May 20, 2024
@xxhZs xxhZs requested review from fuyufjh and wenym1 May 20, 2024 03:33
src/connector/src/sink/doris_starrocks_connector.rs Outdated Show resolved Hide resolved
src/connector/src/sink/doris.rs Outdated Show resolved Hide resolved
fix

fmt
@xxhZs xxhZs force-pushed the xxh/sink-subset branch from 9ac2780 to 6cdeb56 Compare May 20, 2024 05:32
src/connector/src/sink/doris.rs Outdated Show resolved Hide resolved
@@ -143,6 +143,7 @@ impl HeaderBuilder {
self
}

/// Only use in Starrocks
Copy link
Contributor

Choose a reason for hiding this comment

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

How does user to enable partial_update on starrocks sink? I think they can reuse the same with options on user side, but just set different header for different implementations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

like create sink with(partial_update = 'true');

@@ -125,8 +127,11 @@ impl DorisSink {
.collect();

let rw_fields_name = self.schema.fields();
if rw_fields_name.len().ne(&doris_columns_desc.len()) {
return Err(SinkError::Doris("The length of the RisingWave column must be equal to the length of the doris column".to_string()));
if rw_fields_name.len().gt(&doris_columns_desc.len()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Use > here instead of gt.

And should we allow gt only when partial update is enabled in the with options?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In theory, these are two things, gt thought that the column of rw was a downstream subset, while partial_update means opening starrocks/doris's feature

@hzxa21 hzxa21 added the user-facing-changes Contains changes that are visible to users label May 22, 2024
@fuyufjh
Copy link
Member

fuyufjh commented Jun 18, 2024

@xxhZs Any updates?

@fuyufjh fuyufjh requested review from fuyufjh and wenym1 June 18, 2024 02:49
@xxhZs xxhZs enabled auto-merge June 18, 2024 07:57
@xxhZs xxhZs added this pull request to the merge queue Jun 18, 2024
Merged via the queue into main with commit ab1c71b Jun 18, 2024
29 of 30 checks passed
@xxhZs xxhZs deleted the xxh/sink-subset branch June 18, 2024 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature user-facing-changes Contains changes that are visible to users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(cassandra-sink): sink columns can be subset of target
4 participants