Sql Aggregation functions not working on segment

Hi! I really need help, maybe someone could help me?

On one segment in druid: sql aggregation functions like SUM, MAX, MIN are not working. They return zero instead of real answer.

But if i use SUM(basesum * 1) instead of SUM(basesum) all work fine!!!

Or when I use druid aggregation column sum_basesum ( { “type” : “doubleSum”, “name” : “sum_basesum”, “fieldName” : “basesum” } )

My sql:


SUM(basesum * 1) as “SUM(basesum * 1)”,

SUM(sum_basesum) as “SUM(sum_basesum)”,

SUM(basesum) as “SUM(basesum)”,

// BONUS!!!

MAX(basesum) as “MAX(basesum)”,

MIN(basesum) as “MIN(basesum)”,

MAX(basesum * 1) as “MAX(basesum)”,

MIN(basesum * 1) as “MIN(basesum)”

from druid.checks

WHERE “__time” >= ‘2019-08-05 00:00:00’

AND “__time” <= ‘2019-08-10 00:00:00’




I’m using broker and historical cache, maybe it’s a problem?

After reboot all nodes in cluster I have same problem.

I’m using hadoop indexing tasks. In payload I define basesum like this:


“name”: “basesum”,

“type”: “double”



Any thoughts why it’s not working? Thanks!

A few things you could check:

What version of Druid is this?

You can try narrowing down the time interval in the query to see if that affects the results.

You can also run some segment metadata queries on that interval (https://druid.apache.org/docs/latest/querying/segmentmetadataquery.html) and double check that all of the columns of the segments within that interval have the expected types.

I’m using broker and historical cache, maybe it’s a problem?

If you click the “…” next to “Run with limit”, there should be an option to disable caching for a query, try running with that off.