The ES|QL `COUNT_DISTINCT` function fails with an `illegal agg type: text` error when it's run on a `text` field. It's fine with `keyword` fields. Compare to for example `COUNT`, which runs fine on text fields:

```
PUT test/_doc/1
{
  "foo": "bar"
}

# This fails with illegal agg type: text:
POST /_query
{
  "query": """
    FROM test
    | STATS count = COUNT_DISTINCT(foo)
  """
}

# This works:
POST /_query
{
  "query": """
    FROM test
    | STATS count = COUNT_DISTINCT(foo.keyword)
  """
}

# COUNT is fine with text fields:
POST /_query
{
  "query": """
    FROM test
    | STATS count = COUNT(foo)
  """
}
```

Full error message:

```
{
  "error": {
    "root_cause": [
      {
        "type": "esql_illegal_argument_exception",
        "reason": "illegal agg type: text"
      }
    ],
    "type": "esql_illegal_argument_exception",
    "reason": "illegal agg type: text"
  },
  "status": 500
}
```
x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/EsqlActionIT.java
}
    public void testStringLength() {
        try (EsqlQueryResponse results = run("from test | eval l = length(color)")) {
            logger.info(results);
            assertThat(getValuesList(results), hasSize(40));
            int countIndex = results.columns().indexOf(new ColumnInfo("l", "integer"));
            for (List<Object> values : getValuesList(results)) {
                assertThat((Integer) values.get(countIndex), greaterThanOrEqualTo(3));
            }
        }
    }
    public void testFilterWithNullAndEvalFromIndex() {
        
        client().prepareBulk().add(new IndexRequest("test").id("no_count").source("data", 12, "data_d", 2d, "color", "red")).get();
        client().admin().indices().prepareRefresh("test").get();
        
        try (EsqlQueryResponse results = run("from test")) {
            assertEquals(41, getValuesList(results).size());
        }
        try (EsqlQueryResponse results = run("from test | eval newCount = count + 1 | where newCount > 1")) {
            logger.info(results);
            assertEquals(40, getValuesList(results).size());
            assertThat(results.columns(), hasItem(equalTo(new ColumnInfo("count", "long"))));
            assertThat(results.columns(), hasItem(equalTo(new ColumnInfo("count_d", "double"))));
            assertThat(results.columns(), hasItem(equalTo(new ColumnInfo("data", "long"))));
            assertThat(results.columns(), hasItem(equalTo(new ColumnInfo("data_d", "double"))));
            assertThat(results.columns(), hasItem(equalTo(new ColumnInfo("time", "long"))));
        }
    }
    public void testMultiConditionalWhere() {