flink sql支持创建临时函数吗?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

flink sql支持创建临时函数吗?

casel.chen
如下
CREATE TEMPORARY FUNCTION get_seniority(tenure INT64) AS (

   CASE WHEN tenure < 1 THEN "analyst"

        WHEN tenure BETWEEN 1 and 3 THEN "associate"

        WHEN tenure BETWEEN 3 and 5 THEN "senior"

        WHEN tenure > 5 THEN "vp"

        ELSE "n/a"

   END

);



SELECT name

     , get_seniority(tenure) as seniority

FROM employees