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

Group TEXT field failed in Elasticsearch Adapter

    XMLWordPrintableJSON

Details

    Description

      Adding a text type field "cat6" in AggregationTest.java, I've run the following SQL:

      @Test void testGroupTextField() {
          CalciteAssert.that()
              .with(newConnectionFactory())
              .query("select cat6 from view group by cat6")
              .returns("EXPR$0=1\n");
        }
      

      and I get such exception:

      {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [cat6] in order to load field data by uninverting the inverted index. Note that this can use significant memory."}],......(useless message),"status":400}
      

      As Elasticsearch does supports grouping text field(memory consumed), it's better to show SQL users how to implement it in Calcite by enriching ES's test cases.

      Attachments

        Issue Links

          Activity

            People

              VAE ZheHu
              VAE ZheHu
              Votes:
              0 Vote for this issue
              Watchers:
              3 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 - 10m
                  10m