some issue about "groupBy"

Hi,

I used the druid version 0.8.1-rc2. There some issue when using “groupBy”.

The “groupBy” query described as below.

{

"queryType": "groupBy", 

"dataSource": "detail_report", 

"granularity": "day", 

"intervals": [

    "2015-10-16T00:00:00+00:00/2015-10-17T00:00:00+00:00"

], 

"aggregations": [

    {

        "type": "longSum", 

        "name": "pv", 

        "fieldName": "impressions"

    }, 

    {

        "type": "longSum", 

        "name": "click", 

        "fieldName": "clicks"

    }, 

    {

        "type": "longSum", 

        "name": "conversion", 

        "fieldName": "installs"

    }, 

    {

        "type": "doubleSum", 

        "name": "revenue", 

        "fieldName": "revenue"

    }, 

    {

        "type": "doubleSum", 

        "name": "videoview", 

        "fieldName": "video_metrics"

    }

], 

"filter": {

    "type": "and", 

    "fields": [

        {

            "dimension": "expid", 

            "type": "selector", 

            "value": "*"

        }

    ]

}, 

"dimensions": [

    "video_metrics_type"

], 

"having": {

    "type": "greaterThan", 

    "value": 448362479, 

    "aggregation": "pv"

}

}

It can get result:

[

{

    "version": "v1",

    "timestamp": "2015-10-16T00:00:00.000Z",

    "event": {

        "video_metrics_type": "0",

        "conversion": 217704,

        "click": 9090440,

        "pv": 448362485,

        "videoview": 0,

        "revenue": 146902.48046875

    }

}

]

But when I change the condition that change “having” greater than 448362480, It return the empty result.

{

"queryType": "groupBy", 

"dataSource": "detail_report", 

"granularity": "day", 

"intervals": [

    "2015-10-16T00:00:00+00:00/2015-10-17T00:00:00+00:00"

], 

"aggregations": [

    {

        "type": "longSum", 

        "name": "pv", 

        "fieldName": "impressions"

    }, 

    {

        "type": "longSum", 

        "name": "click", 

        "fieldName": "clicks"

    }, 

    {

        "type": "longSum", 

        "name": "conversion", 

        "fieldName": "installs"

    }, 

    {

        "type": "doubleSum", 

        "name": "revenue", 

        "fieldName": "revenue"

    }, 

    {

        "type": "doubleSum", 

        "name": "videoview", 

        "fieldName": "video_metrics"

    }

], 

"filter": {

    "type": "and", 

    "fields": [

        {

            "dimension": "expid", 

            "type": "selector", 

            "value": "*"

        }

    ]

}, 

"dimensions": [

    "video_metrics_type"

], 

"having": {

    "type": "greaterThan", 

    "value": 448362480, 

    "aggregation": "pv"

}

}

Could somebody help to check it?

Thanks,

Tao

Hi,

that looks like an issue caused by usage of floats for comparing those numbers. this should be easy to fix, let me see and update that.

– Himanshu

Hi,

Is it possible for you to try out https://github.com/druid-io/druid/pull/1855 ?

– Himanshu

OK, Thanks Himanshu very much

在 2015年10月24日星期六 UTC+8上午10:47:30,Himanshu Gupta写道: