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
try (var results = run("from test | eval abc = 1+2 | where (abc + count >= 44 or data_d == 2) and data == 1 | keep color, abc")) {
            logger.info(results);
            assertEquals(10, getValuesList(results).size());
            assertEquals(2, results.columns().size());
            for (List<Object> values : getValuesList(results)) {
                assertThat((String) values.get(0), equalTo("green"));
                assertThat((Integer) values.get(1), equalTo(3));
            }
        }
    }
    public void testWhereNegatedCondition() {
        try (var results = run("from test | eval abc=1+2 | where abc + count > 45 and data != 1 | keep color, data")) {
            logger.info(results);
            assertEquals(10, getValuesList(results).size());
            assertEquals(2, results.columns().size());
            for (List<Object> values : getValuesList(results)) {
                assertThat((String) values.get(0), equalTo("red"));
                assertThat((Long) values.get(1), equalTo(2L));
            }
        }
    }
    public void testEvalOverride() {
        try (var results = run("from test | eval count = count + 1 | eval count = count + 1")) {
            logger.info(results);
            assertEquals(40, getValuesList(results).size());
            assertEquals(1, results.columns().stream().filter(c -> c.name().equals("count")).count());
            int countIndex = results.columns().size() - 1;
            assertEquals(new ColumnInfo("count", "long"), results.columns().get(countIndex));
            for (List<Object> values : getValuesList(results)) {
                assertThat((Long) values.get(countIndex), greaterThanOrEqualTo(42L));