Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-2890

ElasticSearch adapter. Combine any_value with other aggregation functions failed

    XMLWordPrintableJSON

Details

    Description

      As Andrei Sereda provided in CALCITE-2679, the following test cases cannot pass.

      // combine any_value with other aggregation functions (eg. max)
      CalciteAssert.that()
        .with(newConnectionFactory())
        .query("select cat1, any_value(cat2), max(val1) from view group by cat1")
        .returnsUnordered("cat1=a; EXPR$1=g; EXPR$2=1.0",
          "cat1=null; EXPR$1=g; EXPR$2=null",
          "cat1=b; EXPR$1=h; EXPR$2=7.0");
      
      CalciteAssert.that()
        .with(newConnectionFactory())
        .query("select max(val1), cat1, any_value(cat2) from view group by cat1")
        .returnsUnordered("EXPR$0=1.0; cat1=a; EXPR$2=g",
          "EXPR$0=null; cat1=null; EXPR$2=g",
          "EXPR$0=7.0; cat1=b; EXPR$2=h");
      
      CalciteAssert.that()
        .with(newConnectionFactory())
        .query("select any_value(cat2), cat1, max(val1) from view group by cat1")
        .returnsUnordered("EXPR$0=g; cat1=a; EXPR$2=1.0",
          "EXPR$0=g; cat1=null; EXPR$2=null",
          "EXPR$0=h; cat1=b; EXPR$2=7.0");
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Functor10 Siyuan Liu
              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 - 40m
                  40m