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 testProjectRename() {
        try (var results = run("from test | eval y = count | rename count as x | keep x, y")) {
            logger.info(results);
            assertEquals(40, getValuesList(results).size());
            assertThat(results.columns(), contains(new ColumnInfo("x", "long"), new ColumnInfo("y", "long")));
            for (List<Object> values : getValuesList(results)) {
                assertThat((Long) values.get(0), greaterThanOrEqualTo(40L));
                assertThat(values.get(1), is(values.get(0)));
            }
        }
    }
    public void testProjectRenameEval() {
        try (var results = run("from test | eval y = count | rename count as x | keep x, y | eval x2 = x + 1 | eval y2 = y + 2")) {
            logger.info(results);
            assertEquals(40, getValuesList(results).size());
            assertThat(
                results.columns(),
                contains(
                    new ColumnInfo("x", "long"),
                    new ColumnInfo("y", "long"),
                    new ColumnInfo("x2", "long"),
                    new ColumnInfo("y2", "long")
                )
            );
            for (List<Object> values : getValuesList(results)) {
                assertThat((Long) values.get(0), greaterThanOrEqualTo(40L));
                assertThat(values.get(1), is(values.get(0)));