Flink upgrade to 1.10: function

Posted by seeksst on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/Flink-upgrade-to-1-10-function-tp34366.html

Hi, All


Recently, I try to upgrade flink from 1.8.2 to 1.10, but i meet some problem about function. In 1.8.2, there are just Built-In function and User-defined Functions, but in 1.10, there are 4 categories of funtions.

I defined a function which named JSON_VALUE in my system, it doesn’t exist in 1.8.2, but present to 1.10.0. of course i use it in sql, something like  'select JSON_VALUE(string, string) from table1’, no category or database. the problem is in 1.10.0, my function will be recognized as SqlJsonValueFunction, and args not match, so my sql is wrong.

        I read document about Ambiguous Function Reference, In my understanding, my function will be registered as temporary system function, and it should be chosen first. isn’t it? I try to debug it, and find some information:

First, sql will be parsed by ParseImpl, and JSON_VALUE will be parsed as SqlBasicCall, operator is SqlJsonValueFunction, it’s belonged to SYSTEM catalog and the kind is OTHER_FUNCTION. Then, SqlUtil.lookupRoutine will not find this SqlFunction, because it not in BasicOperatorTable. my function in FunctionCatalog, but SqlJsonValueFunction belonged to SYSTEM, not belong to USER_DEFINED, so program will not search it in FunctionCatalog.

How can i solve this problem without modifying sql and function name? my program can choose flink version and have many sql jobs, so i don’t wish to modify sql and function name.

Thansk.