Skip to content

GroupBy having filters seemingly work only one Numeric columns #1984

@vogievetsky

Description

@vogievetsky

I am trying to run the following query:

{
  "queryType": "groupBy",
  "dataSource": "wikipedia",
  "intervals": [
    "2015-11-15/2015-11-18"
  ],
  "granularity": "all",
  "aggregations": [
    {
      "name": "count",
      "type": "doubleSum",
      "fieldName": "count"
    }
  ],
  "dimensions": [
    {
      "type": "default",
      "dimension": "country",
      "outputName": "Country"
    }
  ],
  "limitSpec": {
    "type": "default",
    "columns": [
      {
        "dimension": "count",
        "direction": "descending"
      }
    ]
  },
  "having": {
    "type": "or",
    "havingSpecs": [
      {
        "type": "equalTo",
        "aggregation": "Country",
        "value": "USA"
      },
      {
        "type": "lessThan",
        "aggregation": "count",
        "value": 100
      }
    ]
  }
}

And I am getting an error of:

{
  "error" : "Can not construct instance of java.lang.Number from String value 'USA': not a valid number\n at [Source: HttpInputOverHTTP@78359cf4; line: 1, column: 611] (through reference chain: java.util.ArrayList[0])"
}

Which is obviously incorrect since everyone knows that Number('USA') == 1

But seriously it would be great to have having filters be able to work on string columns as well. (without resorting to a nested groupBy)

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

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions