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

Flink SQL returns wrong results for Paimon tables with complex schemas

    XMLWordPrintableJSON

Details

    Description

      We have a Paimon table with some nested files such as the following one.

      `f1` ROW <
                  `f2` ROW <
                      `f3` ARRAY < ROW < `key` INT, `value` FLOAT > NOT NULL >,
                      `f4` ARRAY < ROW < `key` INT, `value` STRING > NOT NULL >,
                      `f5` ARRAY < ROW < `key` BIGINT, `value` FLOAT > NOT NULL >,
                      `f6` ARRAY < ROW < `key` BIGINT, `value` BIGINT > NOT NULL >,
                      `f7` ARRAY < ROW < `key` BIGINT, `value` ROW < `f71` ARRAY < FLOAT > > > NOT NULL >,
                      `f8` ARRAY < ROW < `f81` STRING, `f82` STRING, `f83` BIGINT > NOT NULL >,
                      `f9` ARRAY < ROW < `key` BIGINT, `value` ROW < `f91` ARRAY < BIGINT > > > NOT NULL >,
                      `f10` ROW < `f101` ARRAY < ROW < `f102` BIGINT, `f103` STRING, `f104` BIGINT > NOT NULL > >,
                      `f11` ARRAY < ROW < `key` BIGINT, `value` STRING > NOT NULL >
                  >
      

      When a select query includes some nested columns, the results will be wrong.

      For example, SELECT CARDINALITY(f1.f2.f3) AS r FROM...WHERE... can return correct results but SELECT CARDINALITY(f1.f2.f3) AS r, f1 FROM...WHERE... will return wrong values for r.

      The query execution won't throw any exception but fails silently.

      I'm not sure if this is a Paimon-specific issue, but I also tested running the same query with Spark and StarRocks, and both of them can produce correct results.

       

      Attachments

        1. screenshot-1.png
          300 kB
          Xingcan Cui

        Activity

          People

            xuyangzhong xuyang
            xccui Xingcan Cui
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: