Vova Vysotskyi created CALCITE-4440:
---------------------------------------

             Summary: Query on elasticsearch adapter with literal returns 
incorrect results
                 Key: CALCITE-4440
                 URL: https://issues.apache.org/jira/browse/CALCITE-4440
             Project: Calcite
          Issue Type: Bug
    Affects Versions: 1.26.0
            Reporter: Vova Vysotskyi


The following test added to {{Projection2Test}} class:
{code:java}
  @Test void projectionLiteral() {
    CalciteAssert.that()
        .with(newConnectionFactory())
        .query(
            String.format(Locale.ROOT, "select 2 as \"a\", * from 
\"elastic\".\"%s\"", NAME))
        .returns("a=2, _MAP={a=1, b={a=2, b=3, c={a=foo}}}\n");
  }
{code}
fails with the following assertion error:
{noformat}
Expected: is "a=2, _MAP={a=1, b={a=2, b=3, c={a=foo}}}\n"
     but: was "a=1; _MAP={a=1, b={a=2, b=3, c={a=foo}}}\n"
{noformat}
Please note, instead of the literal, value of the table column with the same 
name as the literal's one was returned. For the case when specified unique 
column name, null is returned.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to