Skip to content

Instantly share code, notes, and snippets.

@akshaydixi
Created March 14, 2015 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akshaydixi/f4f0e3097bc26c14ec64 to your computer and use it in GitHub Desktop.
Save akshaydixi/f4f0e3097bc26c14ec64 to your computer and use it in GitHub Desktop.
Testing foldWindow for FLINK-1450
package com.dixit.flinktrial
import java.util.concurrent.TimeUnit
import org.apache.flink.streaming.api.scala._
import org.apache.flink.streaming.api.windowing.helper.Time
object SocketTextStreamWordCount {
def main(args: Array[String]) {
val hostName = args(0)
val port = args(1).toInt
val env = StreamExecutionEnvironment.getExecutionEnvironment
val text = env.socketTextStream(hostName, port).window(Time.of(1, TimeUnit.MINUTES)).every(Time.of(10,TimeUnit.SECONDS)).foldWindow(0, (x: Int, y: Any) => x + 1)
text print()
env.execute("Testing foldWindow")
}
}
@akshaydixi
Copy link
Author

Exception in thread "main" org.apache.flink.api.common.functions.InvalidTypesException: Type of TypeVariable 'T' in 'class org.apache.flink.streaming.api.scala.WindowedDataStream' could not be determined. This is most likely a type erasure problem. The type extraction currently supports types with generic variables only in cases where all variables in the return type can be deduced from the input type(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment