Skip to content

KAFKA-18026: KIP-1112, migrate foreign-key joins to use ProcesserSupplier#stores #18194

Merged
ableegoldman merged 4 commits intoapache:trunkfrom
ableegoldman:KIP-112-convert-FKJ
Dec 16, 2024
Merged

KAFKA-18026: KIP-1112, migrate foreign-key joins to use ProcesserSupplier#stores #18194
ableegoldman merged 4 commits intoapache:trunkfrom
ableegoldman:KIP-112-convert-FKJ

Conversation

@ableegoldman
Copy link
Copy Markdown
Member

Convert FKJ processors to implementing the #stores method

@github-actions github-actions bot added triage PRs from the community streams labels Dec 15, 2024
Copy link
Copy Markdown
Contributor

@guozhangwang guozhangwang left a comment

Choose a reason for hiding this comment

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

One nit question about unit test, please feel free to merge afterwards.


final String foreignTableJoinName = renamed
.suffixWithOrElseGet("-foreign-join-subscription", builder, SUBSCRIPTION_PROCESSOR);
final StatefulProcessorNode<KO, Change<VO>> foreignTableJoinNode = new ForeignTableJoinNode<>(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just curious is the final goal to eventually remove StatefulProcessorNode and only use ProcessorGraphNode?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

good question -- basically yes and no. Almost everything has/will be converted from StatefulProcesorNode to ProcessorGraphNode, but there are a few exceptions where we still need the StatefulProcessorNode to connect a processor and state store. For example any processors that access upstream state via a value getter, or a custom ProcessorSupplier passed into the .process/.processValues operator that doesn't implement #stores and manually adds stores by calling StreamsBuilder#addStateStore instead.

I actually have the PR for this ready but it was done on top of this so I was waiting for this one to be merged before calling for review. But it's ready now if you want to take a look (though note that it still can't be merged until Almog's TableSuppressNode PR is merged). See #18195

(v1, v2) -> v1 + v2,
TableJoined.as("l-join"),
Materialized.<String, String, KeyValueStore<Bytes, byte[]>>as("materialized-store").withValueSerde(Serdes.String()))
.toStream(Named.as("toStream")) // 6
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What the comment // 6 is about? I think this test case still only have 5 store?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

copy-paste error 🙃 thanks

And yeah, it should have 5 stores

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ill address this in my next PR so i doin't have to run the tests again before merging

@github-actions github-actions bot removed the triage PRs from the community label Dec 15, 2024
@ableegoldman
Copy link
Copy Markdown
Member Author

test failure is unrelated, merging to trunk

@ableegoldman ableegoldman merged commit bac8928 into apache:trunk Dec 16, 2024
tedyu pushed a commit to tedyu/kafka that referenced this pull request Jan 6, 2025
…lier#stores (apache#18194)

Convert FKJ processors to implementing the #stores method

Reviewers: Guozhang Wang <guozhang.wang.us@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants