twalthr commented on a change in pull request #13320:
URL: https://github.com/apache/flink/pull/13320#discussion_r483589525
##########
File path:
flink-streaming-scala/src/test/scala/org/apache/flink/streaming/api/scala/AllWindowTranslationTest.scala
##########
@@ -91,54 +91,10 @@ class AllWindowTranslationTest {
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
- .windowAll(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 precondition
// ------------------------------------------------------------------------
- @Test
- def testSessionWithFoldFails() {
- // verify that fold does not work with merging windows
- val env = StreamExecutionEnvironment.getExecutionEnvironment
-
- val windowedStream = env.fromElements("Hello", "Ciao")
- .windowAll(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:
[email protected]