Sxnan commented on code in PR #20618:
URL: https://github.com/apache/flink/pull/20618#discussion_r949740721


##########
flink-python/pyflink/datastream/data_stream.py:
##########
@@ -895,6 +895,20 @@ def get_side_output(self, output_tag: OutputTag) -> 
'DataStream':
         """
         return 
DataStream(self._j_data_stream.getSideOutput(output_tag.get_java_output_tag()))
 
+    def cache(self) -> 'DataStream':
+        """
+        Cache the intermediate result of the transformation. Only support 
bounded streams and
+        currently only block mode is supported. The cache is generated lazily 
at the first time the
+        intermediate result is computed. The cache will be clear when the 
StreamExecutionEnvironment
+        close.
+
+        :return: The cached DataStream that can use in later job to reuse the 
cached intermediate
+                 result.
+
+        .. versionadded:: 1.16.0
+        """
+        return DataStream(self._j_data_stream.cache())

Review Comment:
   On top of that, we also introduce `SideOutputDataStream` which supports the 
cache method. I think we may need to introduce `SideOutputDataStream` in 
PyFlink and let get_side_output return `SideOutputDataStream`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to