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

Reworded the documentation for lastByKeyColumns. #1935

Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1381,9 +1381,13 @@ private static String[] getColumnNames(
* @param keySpec Conversion specification for Kafka record keys from table column data.
* @param valueSpec Conversion specification for Kafka record values from table column data.
* @param lastByKeyColumns Whether to publish only the last record for each unique key. Ignored when {@code keySpec}
* is {@code IGNORE}. If {@code keySpec != null && !lastByKeyColumns}, it is expected that {@code table} will
* not produce any row shifts; that is, the publisher expects keyed tables to be streams, add-only, or
* aggregated.
* is {@code IGNORE}. If {@code lastByKeyColumns == true}, it is expected that {@code table} is an add-only
Copy link
Member

Choose a reason for hiding this comment

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

This is backwards. If {@code lastByKeyColumns == true} we will apply the aggregation ourselves, and so none of this wording applies.

* stream, or the result of an aggregation; a general refreshing table where rows can change position in
* arbitrary ways (eg, the result of {@code sort}) is not allowed. In DH engine technical terms, when
Copy link
Member

Choose a reason for hiding this comment

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

e.g.

* {@code lastByKeyColumns == true} the updates to {@code table} should not produce any row shifts. A table
Copy link
Member

Choose a reason for hiding this comment

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

There is a debate to be had about whether we actually want to restrict shifts for keyed tables. I remain convinced that the answer is yes. @cpwright should weigh in as well.

* generated from a Kafka stream via {@code consumeToTable} trivially satisfies this constraint. Any
* operations over such a table that do not reorder rows also satisfy the constraint.
*
* @return a callback to stop producing and shut down the associated table listener; note a caller should keep a
* reference to this return value to ensure liveliness.
*/
Expand Down