-
Notifications
You must be signed in to change notification settings - Fork 595
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
fix(sink): derive append only from optimizer when no format declared #14065
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #14065 +/- ##
==========================================
- Coverage 68.10% 68.10% -0.01%
==========================================
Files 1543 1543
Lines 267107 267111 +4
==========================================
+ Hits 181915 181917 +2
- Misses 85192 85194 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code itself lgtm as long as all the behavior changes are intentional. Please confirm before merge.
(false, true, true) => Ok(SinkType::ForceAppendOnly), | ||
(_, false, false) => Ok(SinkType::Upsert), | ||
(false, true, false) => { | ||
(true, DefinedAppendOnly|NotDefined, _) => Ok(SinkType::AppendOnly), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strictly speaking, this is a backward incompatible change: NotDefined
was considered false
before this PR, even when frontend derives it is actually append only. It used to return SinkType::Upsert
in this case. This may or may not be a real problem.
One such example:
https://github.com/risingwavelabs/risingwave/blob/main/integration_tests/elasticsearch-sink/create_sink.sql
To list all behavior changes:
frontend derived | user defined | user force | old | new |
---|---|---|---|---|
true | undefined | true | err cannot force | SinkType::AppendOnly |
true | undefined | false | SinkType::Upsert |
SinkType::AppendOnly |
false | undefined | true | err cannot force | SinkType::ForceAppendOnly |
false | undefined | false | SinkType::Upsert |
SinkType::Upsert (no change) |
Based on our previous discussion, we wanted to make format
required if backward compatibility was not a concern. This PR is actually making the backward compatibility promise harder to maintain, as undefined
can now mean AppendOnly/ForceAppendOnly/Upsert in different cases, which used to be always Upsert. cc @tabVersion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your clarification. If we do not maintain the compatibility for those errored statements, the only change is this one.
this is a backward incompatible change: NotDefined was considered false before this PR, even when frontend derives it is actually append only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do not maintain the compatibility for those errored statements
In my opinion, it is okay now to move from err to non-err in this PR. However, if we want to move from non-err to err again in the future, it would be a breaking change. This is what I mean by making the backward compatibility promise harder to maintain.
After offline, it will be implemented with a less invasive method |
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
which is especially useful for "CREATE SINK INTO TABLE"
Checklist
./risedev check
(or alias,./risedev c
)Documentation
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.