Skip to content

Optimize group by for single partition topics #836

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ovv
Copy link
Contributor

@ovv ovv commented Apr 14, 2025

Group by operations on topics with a single partition are now optimized to avoid creating a repartition topic. Instead, the messages are directly transformed to use the new key, as all messages go to the same partition.

@ovv ovv changed the title Optimize groupb y for single partition topics Optimize group by for single partition topics Apr 15, 2025
@ovv ovv force-pushed the quent/single-partition-groupby branch from 85cf8af to 87f2af7 Compare April 15, 2025 12:46
Group by operations on topics with a single partition are now optimized to avoid
creating a repartition topic. Instead, the messages are directly transformed to
use the new key, as all messages go to the same partition.
@ovv ovv force-pushed the quent/single-partition-groupby branch from 87f2af7 to 5999c3a Compare April 15, 2025 12:53
@ovv ovv marked this pull request as ready for review April 16, 2025 11:58
@@ -135,15 +135,20 @@ def __init__(
registry: DataFrameRegistry,
processing_context: ProcessingContext,
stream: Optional[Stream] = None,
stream_id: Optional[str] = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a note. This proves that we need to rename it to state_id.

  1. Passing both stream and stream_id is a rather strange API.
  2. The Stream class does not feature any id itself - counterintuitive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants