Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-22405

Support fixed-length chars in the LeadLag built-in function

    XMLWordPrintableJSON

Details

    Description

      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:

      CREATE TEMPORARY VIEW test_cardinality AS
      SELECT * FROM ( VALUES
        ('Alice', 'alice@test.com', ARRAY [ 'alice@test.com' ], 'Test Ltd'),
        ('Alice', 'alice@test.com', ARRAY [ 'alice@test.com' ], 'Test Ltd'),
        ('Alice', 'alice@test2.com', ARRAY [ 'alice@test.com', 'alice@test2.com' ], 'Test Ltd'))
      AS t ( name, email, aliases, company );
      
      SELECT
        name,
        LEAD(company, 0) AS company
      FROM test_cardinality
      WHERE CARDINALITY(aliases) >= 2
      GROUP BY name;
      

      -> see https://github.com/apache/flink/blob/release-1.13.0-rc1/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/utils/AggFunctionFactory.scala#L331

      Attachments

        Issue Links

          Activity

            People

              liliwei liwei li
              nkruber Nico Kruber
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: