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

GROUP BY might get wrong results under certain circumstances in Elasticsearch Adapter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.28.0
    • None
    • elasticsearch-adapter
    • None

    Description

      In Elasticsearch Adapter, if one field is grouped by along with missing value, SQL user might get incorrect results. Take the following case as an example:

      ES mappings: {"int_field1" : integer, "int_field2" : integer}
      
      doc1 = {"int_field1":1, "int_field2": -2147483648}
      doc1 = {"int_field1":2}
      

      When I try "select count(1) as CNT from view group by int_field2", the result is 2.

      For Integer type, the missing value is replaced by Integer.MIN_VALUE, so doc1 and doc2 will be divided in the same group.

      Any other data types like short、long、float、double, they also have such problem.

      Attachments

        Issue Links

          Activity

            People

              VAE ZheHu
              VAE ZheHu
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: