Skip to content
Advertisement

Cannot infer type-variable(s) R in Flink ProcessWindowFunction

I am having trouble with resolving this error in Flink (Version 1.11.0):

JavaScript

This is how I create a keyed windowed stream:

JavaScript

And here is how my ComputeFeatures function looks like:

JavaScript

The StreamElement::getId returns a Long so everything regarding types should be correct, but it seems that Flink still has trouble inferring a type. I am looking for ideas how to solve this.

NOTE: This issue seems related but it didn’t fit my problem: LINK

EDIT 1: As suggested by David I tried autogenerating the overridden process function with IntelliJ, but the issue still remains the same. The autogenerated code looks like this in case of specifying types:

JavaScript

And like this when I omit type specification:

JavaScript

EDIT 2: Maybe relevant: When I hover over new ComputeFeatures() IntelliJ displays this infobox:

JavaScript

Advertisement

Answer

Eh stupid mistake, the code works as it is, the problem was that IntelliJ imported a wrong ProcessWindowFunction (the Scala variant). After changing that everything worked as expected

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement