Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-2867 JSON support
  3. CALCITE-2787

JSON aggregate calls with different null clause get incorrectly merged during converting from SQL to relational algebra

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.18.0
    • 1.19.0
    • core

    Description

      SQL:
       

      WITH tab(x) AS (VALUES 1, 2, 1, CAST(NULL AS INTEGER))
      SELECT JSON_ARRAYAGG(x), JSON_ARRAYAGG(x NULL ON NULl) FROM tab
      

      Produces:

      EXPR$0  |EXPR$1  |
      --------|--------|
      [1,2,1] |[1,2,1] |
      

      Should be:

      EXPR$0  |EXPR$1  |
      --------|--------|
      [1,2,1] |[1,2,1,null] |
      

      Attachments

        Issue Links

          Activity

            People

              zhztheplayer Hongze Zhang
              zhztheplayer Hongze Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m