[jira] [Created] (FLINK-22405) Support fixed-lengh chars in the LeadLag built-in function

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

[jira] [Created] (FLINK-22405) Support fixed-lengh chars in the LeadLag built-in function

Shang Yuanchun (Jira)
Nico Kruber created FLINK-22405:
-----------------------------------

             Summary: Support fixed-lengh chars in the LeadLag built-in function
                 Key: FLINK-22405
                 URL: https://issues.apache.org/jira/browse/FLINK-22405
             Project: Flink
          Issue Type: Improvement
          Components: Table SQL / API
    Affects Versions: 1.12.2
            Reporter: Nico Kruber


LeadLag aggregate function does not support type: ''CHAR'', as in the following example (a CAST to VARCHAR works around this). Technically, there should be no reason though to support STRING/VARCHAR but not CHAR:

{code:sql}
CREATE TEMPORARY VIEW test_cardinality AS
SELECT * FROM ( VALUES
  ('Alice', '[hidden email]', ARRAY [ '[hidden email]' ], 'Test Ltd'),
  ('Alice', '[hidden email]', ARRAY [ '[hidden email]' ], 'Test Ltd'),
  ('Alice', '[hidden email]', ARRAY [ '[hidden email]', '[hidden email]' ], 'Test Ltd'))
AS t ( name, email, aliases, company );
{code}

{code:sql}
SELECT
  name,
  LEAD(company, 0) AS company
FROM test_cardinality
WHERE CARDINALITY(aliases) >= 2
GROUP BY name;
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)