-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-27587][python] Support keyed co-broadcast processing #20144
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
Conversation
| __all__ = ['CloseableIterator', 'DataStream', 'KeyedStream', 'ConnectedStreams', 'WindowedStream', | ||
| 'DataStreamSink', 'CloseableIterator', 'BroadcastStream', 'BroadcastConnectedStream'] | ||
|
|
||
| from pyflink.util.java_utils import to_jarray |
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.
move the import before __all__
| :param ds: The DataStream with which this stream will be connected. | ||
| :return: The ConnectedStreams. | ||
| .. versionchanged:: 1.16.0 | ||
| Support connect BroadcastStream |
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.
| Support connect BroadcastStream | |
| Support connect BroadcastStream |
| :param ctx: A :class:`BroadcastProcessFunction.ReadOnlyContext` that allows querying the | ||
| timestamp of the element, querying the current processing/event time and reading the |
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.
| :param ctx: A :class:`BroadcastProcessFunction.ReadOnlyContext` that allows querying the | |
| timestamp of the element, querying the current processing/event time and reading the | |
| :param ctx: | |
| A :class:`BroadcastProcessFunction.ReadOnlyContext` that allows querying the | |
| timestamp of the element, querying the current processing/event time and reading the |
| * org.apache.flink.streaming.runtime.translators.python.PythonKeyedBroadcastStateTransformationTranslator}. | ||
| */ | ||
| @Internal | ||
| public class PythonKeyedBroadcastStateTransformation<OUT> |
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.
Could PythonKeyedBroadcastStateTransformation extend PythonBroadcastStateTransformation
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.
I've tried before, but there's just some class casting cannot be solved.
| * @param <OUT> The output type of the CoBroadcastProcess function | ||
| */ | ||
| @Internal | ||
| public class PythonBatchKeyedCoBroadcastProcessOperator<OUT> |
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.
add serialVersionUID
| public class PythonBatchKeyedCoBroadcastProcessOperator<OUT> | ||
| extends PythonKeyedCoProcessOperator<OUT> implements BoundedMultiInput, InputSelectable { | ||
|
|
||
| private transient volatile boolean isBroadcastSideDone; |
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.
| private transient volatile boolean isBroadcastSideDone; | |
| private transient volatile boolean isBroadcastSideDone = false; |
f292e4b to
7edad7b
Compare
What is the purpose of the change
This PR implements keyed broadcast processing (
KeyedStream.connect(BroadcastStream).process(KeyedBroadcastProcessFunction)) in PyFlink.Brief change log
KeyedBroadcastProcessFunctioninterface in PythonKeyedBroadcastStateTransformationand its translator in compile keyed broadcast processing intoPythonKeyedCoProcessororPythonBatchKeyedCoBroadcastProcessOperator.Verifying this change
This change added tests and can be verified as follows:
test_keyed_co_broadcast_processin test_data_stream.pyDoes this pull request potentially affect one of the following parts:
@Public(Evolving): (yes)Documentation