Re: Table program cannot be compiled

Posted by Timo Walther on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/Table-program-cannot-be-compiled-tp27852p27898.html

Hi,

too many arguments for calling a UDF could currently lead to "grows beyond 64 KB" and maybe also causes the GC exception. This is a known issue covered in https://issues.apache.org/jira/browse/FLINK-8921.

Could you also add the tags to the function itself? Maybe as a static map for constant time access outside of the eval method?

Regards,
Timo


Am 15.05.19 um 17:10 schrieb Andrey Zagrebin:
Hi, I am looping in Timo and Dawid to look at the problem.

On Tue, May 14, 2019 at 9:12 PM shkob1 <[hidden email]> wrote:
BTW looking at past posts on this issue[1] it should have been fixed? i'm
using version 1.7.2
Also the recommendation was to use a custom function, though that's exactly
what im doing with the conditionalArray function[2]

Thanks!

[1]
http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/DataStreamCalcRule-1802-quot-grows-beyond-64-KB-when-execute-long-sql-td20832.html#a20841

[2]
public class ConditionalArrayFunction extends ScalarFunction {

    public static final String NAME = "conditionalArray";

    public String[] eval(Object... keyValues) {
        if (keyValues.length == 0) {
            return new String[]{};
        }
        final List keyValuesList = Arrays.asList(keyValues);
        List<String> trueItems = Lists.newArrayList();
        for (int i = 0; i < keyValuesList.size(); i = i + 2){
            final String key = (String)keyValuesList.get(i);
            final Object value = keyValuesList.get(i + 1);

            if (value != null && (boolean)value)
                trueItems.add(key);
        }
        return trueItems.toArray(new String[0]);
    }
}




--
Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/