Skip to content

subtotalsSpec and filtering returns no results #7820

@nrwiersma

Description

@nrwiersma

When using both subtotalsSpec and a filter on a renamed dimension, no results are returned.

Affected Version

Druid 0.14.0

Description

All 3 of the following need to be true to encounter the bug:

  • The dimension needs to have renamed
  • There needs to be a filter on any dimension, I have tested both the queried dimension and a completely separate dimension
  • There must be a subtotalsSpec.

And example query looks like this:

{
    "queryType": "groupBy",
    "dataSource": "some_awesome_table",
    "granularity": "all",
    "dimensions": [
        {
            "type":"default",
            "dimension":"country",
            "outputName":"country_name"
        }
    ],
    "filter": {
       "type": "selector",
       "dimension": "country",
       "value": "ZA"
    },
    "aggregations": [
        {
            "type": "count",
            "name": "count"
        }
    ],
    "subtotalsSpec": [["country_name"], []],	
    "intervals": [
        "2019-05-28T00:00:00Z/2019-05-29T00:00:00Z"
    ],
     "context": {
        "useCache": false,
        "populateCache": false,
        "useResultLevelCache": false,
        "populateResultLevelCache": false
     }
}

This query will return [].
If you remove the filter or the subtotalsSpec or make the "outputName" the same as the dimension, results are returned. Using "bySegment: true" in context also returns results.

On a hunch it may have to do with a single result, I have also tested an or filter, and it still returns no results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions