Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.12.0
-
None
Description
Currently queries like
select count(column) from table
is pushed to druid as timeseries with an aggregator
{"type":"count","name":"EXPR$0","fieldName":"countryName"}
Such an aggregator does not exist in druid. The count aggregator does only work as
count(*)
.
here is a test case that summarize the issue.
@Test public void testCount() { final String sql = "SELECT count(\"countryName\") FROM (SELECT \"countryName\" FROM \"wikiticker\" WHERE \"countryName\" IS NOT NULL) as a"; // correct count sql(sql, WIKI_AUTO2).returnsUnordered("EXPR$0=3799"); final String sql2 = "SELECT count(\"countryName\") FROM (SELECT \"countryName\" FROM \"wikiticker\") as a"; sql(sql2, WIKI_AUTO2).returnsUnordered("EXPR$0=3799"); // it will fail }
First test will pass while the second will not.
Attachments
Issue Links
- depends upon
-
CALCITE-1436 AggregateNode NPE for aggregators other than SUM/COUNT
- Closed