flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] twalthr commented on a change in pull request #13320: [FLINK-19035] Remove fold from DataStream API
Date Fri, 04 Sep 2020 12:39:33 GMT

twalthr commented on a change in pull request #13320:
URL: https://github.com/apache/flink/pull/13320#discussion_r483589434



##########
File path: flink-streaming-scala/src/test/scala/org/apache/flink/streaming/api/scala/WindowTranslationTest.scala
##########
@@ -92,56 +93,10 @@ class WindowTranslationTest {
     fail("exception was not thrown")
   }
 
-  /**
-    * .fold() does not support [[RichFoldFunction]], since the reduce function is used internally
-    * in a [[org.apache.flink.api.common.state.FoldingState]].
-    */
-  @Test(expected = classOf[UnsupportedOperationException])
-  def testFoldWithRichFolderFails() {
-    val env = StreamExecutionEnvironment.getExecutionEnvironment
-    val source = env.fromElements(("hello", 1), ("hello", 2))
-
-    env.setStreamTimeCharacteristic(TimeCharacteristic.ProcessingTime)
-
-    source
-      .keyBy(0)
-      .window(SlidingEventTimeWindows.of(Time.seconds(1), Time.milliseconds(100)))
-      .fold(("", 0), new RichFoldFunction[(String, Int), (String, Int)] {
-        override def fold(accumulator: (String, Int), value: (String, Int)) = null
-      })
-
-    fail("exception was not thrown")
-  }
-
   // --------------------------------------------------------------------------
   //  merging window checks
   // --------------------------------------------------------------------------
 
-  @Test
-  def testSessionWithFoldFails() {
-    // verify that fold does not work with merging windows
-    val env = StreamExecutionEnvironment.getExecutionEnvironment
-
-    val windowedStream = env.fromElements("Hello", "Ciao")
-      .keyBy(x => x)
-      .window(EventTimeSessionWindows.withGap(Time.seconds(5)))
-
-    try
-      windowedStream.fold("", new FoldFunction[String, String]() {
-        @throws[Exception]
-        def fold(accumulator: String, value: String): String = accumulator
-      })
-
-    catch {
-      case _: UnsupportedOperationException =>
-        // expected
-        // use a catch to ensure that the exception is thrown by the fold

Review comment:
       same for java
   




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message