ZheHu created CALCITE-4954:
------------------------------
Summary: Group TEXT field failed in Elasticsearch Adapter
Key: CALCITE-4954
URL: https://issues.apache.org/jira/browse/CALCITE-4954
Project: Calcite
Issue Type: Bug
Components: elasticsearch-adapter
Affects Versions: 1.28.0
Reporter: ZheHu
Assignee: ZheHu
Adding a text type field "cat6" in AggregationTest.java, I've run the following
SQL:
{code:java}
@Test void testGroupTextField() {
CalciteAssert.that()
.with(newConnectionFactory())
.query("select cat6 from view group by cat6")
.returns("EXPR$0=1\n");
}
{code}
and I get such exception:
{code:java}
{"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}
{code}
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.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)