You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Siyuan Liu (JIRA)" <ji...@apache.org> on 2019/03/03 16:08:00 UTC

[jira] [Created] (CALCITE-2890) ElasticSearch adapter. Combine any_value with other aggregation functions failed

Siyuan Liu created CALCITE-2890:
-----------------------------------

             Summary: ElasticSearch adapter. Combine any_value with other aggregation functions failed
                 Key: CALCITE-2890
                 URL: https://issues.apache.org/jira/browse/CALCITE-2890
             Project: Calcite
          Issue Type: Bug
          Components: elasticsearch-adapter
    Affects Versions: 1.18.0
            Reporter: Siyuan Liu


As Andrei Sereda provided in CALCITE-2669, the following test cases cannot pass.
{code:java}
// 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");
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)