### Description

Two indices:

**test1**
```
{
    "settings": {
        "routing_path": "event.dataset",
        "index": {
            "mode": "time_series"
        }
    },
    "mappings": {
        "properties": {
            "@timestamp": {
                "type": "date"
            },
            "bytes_counter": {
                "type": "long",
                "time_series_metric": "counter"
            },
            "event": {
                "properties": {
                    "dataset": {
                        "type": "keyword",
                        "time_series_dimension": true
                    }
                }
            }
        }
    }
}
```

with data

```
{ "index": { } }
{ "bytes":123,"@timestamp":123456789, "event.dataset":"x" }
```

**test2**
```
{
    "mappings": {
      "properties": {
        "bytes_counter": {
          "type": "long"
        }
      }
    }
}
```

with no data.

Running `from test* | limit 1` results in 

```
{
    "error": {
        "root_cause": [
            {
                "type": "illegal_argument_exception",
                "reason": "Field type [counter] is not supported"
            }
        ],
        "type": "illegal_argument_exception",
        "reason": "Field type [counter] is not supported"
    },
    "status": 400
}
```

Running `from test* | limit 0` results in

```
{
    "columns": [
        {
            "name": "@timestamp",
            "type": "date"
        },
        {
            "name": "bytes",
            "type": "long"
        },
        {
            "name": "bytes_counter",
            "type": "long"
        },
        {
            "name": "event.dataset",
            "type": "keyword"
        }
    ],
    "values": []
}
```

**Notice above `bytes_counter` as `long`**. Running `from test1 | limit 0` results in

```
{
    "columns": [
        {
            "name": "@timestamp",
            "type": "date"
        },
        {
            "name": "bytes",
            "type": "long"
        },
        {
            "name": "bytes_counter",
            "type": "unsupported"
        },
        {
            "name": "event.dataset",
            "type": "keyword"
        }
    ],
    "values": []
}
```
**Notice now the `bytes_counter` is unsupported**.
In a nutshell, `bytes_counter` is mapped as `long` in both indices, but the additional meta information about test1 variant is that this field is a time series `counter` field which is unsupported. When loading values, the source operator complains that the field is unsupported.
x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/rest/RestSqlTestCase.java
assertNotNull(matchQuery);
        assertEquals("foo", matchQuery.get("query"));
    }
    public void testTranslateQueryWithGroupByAndHaving() throws IOException {
        index("{\"salary\":100}", "{\"age\":20}");
        Map<String, Object> response = runTranslateSql(
            query("SELECT avg(salary) FROM " + indexPattern("test") + " GROUP BY abs(age) HAVING avg(salary) > 50 LIMIT 10").toString()
        );
        assertEquals(response.get("size"), 0);
        assertEquals(false, response.get("_source"));
        assertNull(response.get("stored_fields"));
        @SuppressWarnings("unchecked")
        Map<String, Object> aggregations = (Map<String, Object>) response.get("aggregations");
        assertEquals(1, aggregations.size());
        assertNotNull(aggregations);
        @SuppressWarnings("unchecked")
        Map<String, Object> groupby = (Map<String, Object>) aggregations.get("groupby");
        assertEquals(2, groupby.size());
        @SuppressWarnings("unchecked")
        Map<String, Object> composite = (Map<String, Object>) groupby.get("composite");
        assertEquals(2, composite.size());
        assertEquals(10, composite.get("size"));
        @SuppressWarnings("unchecked")
        List<Object> sources = (List<Object>) composite.get("sources");
        assertEquals(1, sources.size());
        @SuppressWarnings("unchecked")
        Map<String, Object> sourcesListMap = (Map<String, Object>) ((Map<String, Object>) sources.get(0)).values().iterator().next();
        assertEquals(1, sourcesListMap.size());
        @SuppressWarnings("unchecked")
        Map<String, Object> terms = (Map<String, Object>) sourcesListMap.get("terms");