Why the results of "group by" are different when using "having"

Hi,
I used the druid version 0.7.3.1

Why the results of two “group by” query are different?

query 1:

{

"queryType": "groupBy", 

"dataSource": "detail_report", 

"granularity": "all", 

"intervals": [

    "2015-08-29T00:00:00+00:00/2015-08-30T00: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"

    }

], 

"filter": {

    "type": "and", 

    "fields": [

        {

            "dimension": "pkgname", 

            "type": "regex", 

            "pattern": "com.amazon.mShop.android.shopping"

        }, 

        {

            "dimension": "expid", 

            "type": "selector", 

            "value": "*"

        }

    ]

}, 

"dimensions": [

    "pkgname"

], 



"having": {

    "type": "greaterThan", 

    "value": 1.00, 

    "aggregation": "revenue"

}

}

result:

[

{

    "version": "v1",

    "timestamp": "2015-08-29T00:00:00.000Z",

    "event": {

        "conversion": 17,

        "click": 76146,

        "pv": 6218932,

        "pkgname": "com.amazon.mShop.android.shopping",

        "revenue": 2330.9366149902344

    }

}

]

query 2:

{

"queryType": "groupBy", 

"dataSource": "detail_report", 

"granularity": "all", 

"intervals": [

    "2015-08-29T00:00:00+00:00/2015-08-30T00: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"

    }

], 

"filter": {

    "type": "and", 

    "fields": [

        {

            "dimension": "pkgname", 

            "type": "regex", 

            "pattern": "com.amazon.mShop.android.shopping"

        }, 

        {

            "dimension": "expid", 

            "type": "selector", 

            "value": "*"

        }

    ]

}, 

"dimensions": [

    "pkgname"

], 



"having": {

    "type": "greaterThan", 

    "value": 500.00, 

    "aggregation": "revenue"

}

}

result:

[

{

“version”: “v1”,

“timestamp”: “2015-08-29T00:00:00.000Z”,

“event”: {

“conversion”: 3,

“click”: 18223,

“pv”: 1435969,

“pkgname”: “com.amazon.mShop.android.shopping”,

        "revenue": 548.9613647460938

}

}

]

Hi,
looks like you mmight be hitting the issue fixed in https://github.com/druid-io/druid/pull/1361.

Can you try updating to druid 0.8.1-rc2 and I hope that should fix it.