Spatial filter exception

Dear friends in Druid community:

Today I cannot use spatial query ,But it was fine yesterday.

When I query ,the result was always .

My query spec was:

{

"queryType": "groupBy",

"dataSource": "Parking",

"granularity": "HOUR",

"aggregations": [

    {

        "type": "longSum",

        "name": "count",

        "fieldName": "count"

    }

],

"dimensions": [

    "hour"

],

"virtualColumns": [

    {

        "type": "expression",

        "name": "hour",

        "expression": "timestamp_format(__time,'HH')",

        "outputType": "STRING"

    }

],

"intervals": [

    "2019-07-01/2019-07-09"

],

"filter": {

    "type": "and",

    "fields": [

        {

            "type": "spatial",

            "dimension": "coordinates",

            "bound": {

                "type": "rectangular",

                "minCoords": [

                    29.64483479954559,

                    30.11017760734718],

                "maxCoords": [

                    35.762271328705374,

                    114.56886996875713]

            }

        },

        {

            "type": "bound",

            "dimension": "stayHour",

            "lower": 1,

            "lowerStrict": true

        },

        {

            "type": "bound",

            "dimension": "stationDistance",

            "lower": 2,

            "lowerStrict": true

        },

        {

            "type": "bound",

            "dimension": "logisticsParkDistance",

            "lower": 2,

            "lowerStrict": true

        },

        {

            "type": "in",

            "dimension": "dt",

            "values": [

                "gps"

            ]

        }

    ]

}

}

But when I delete the spatial filed, the result was not null, the result was:

[

{

“version”: “v1”,

“timestamp”: “2019-07-01T00:00:00.000Z”,

“event”: {

“hour”: “00”,

“count”: 40198

}

},

{

“version”: “v1”,

“timestamp”: “2019-07-01T01:00:00.000Z”,

“event”: {

“hour”: “01”,

“count”: 859

}

},

{

“version”: “v1”,

“timestamp”: “2019-07-01T02:00:00.000Z”,

“event”: {

“hour”: “02”,

“count”: 949

}

},

{

“version”: “v1”,

“timestamp”: “2019-07-01T03:00:00.000Z”,

“event”: {

“hour”: “03”,

“count”: 1211

}

},

{

“version”: “v1”,

“timestamp”: “2019-07-01T04:00:00.000Z”,

“event”: {

“hour”: “04”,

“count”: 2014

}

},

{

“version”: “v1”,

“timestamp”: “2019-07-01T05:00:00.000Z”,

“event”: {

“hour”: “05”,

“count”: 3619

}

},

{

“version”: “v1”,

“timestamp”: “2019-07-01T06:00:00.000Z”,

“event”: {

“hour”: “06”,

“count”: 4418

}

},

{

“version”: “v1”,

“timestamp”: “2019-07-01T07:00:00.000Z”,

“event”: {

“hour”: “07”,

“count”: 4902

}

},

{

“version”: “v1”,

“timestamp”: “2019-07-01T08:00:00.000Z”,

“event”: {

“hour”: “08”,

“count”: 4880

}

},

{

“version”: “v1”,

“timestamp”: “2019-07-01T09:00:00.000Z”,

“event”: {

“hour”: “09”,

“count”: 4093

}

},

{

“version”: “v1”,

“timestamp”: “2019-07-01T10:00:00.000Z”,

“event”: {

“hour”: “10”,

“count”: 3787

}

},

{

“version”: “v1”,

“timestamp”: “2019-07-01T11:00:00.000Z”,

“event”: {

“hour”: “11”,

“count”: 3386

}

},

{

“version”: “v1”,

“timestamp”: “2019-07-01T12:00:00.000Z”,

“event”: {

“hour”: “12”,

“count”: 3047

}

},

{

“version”: “v1”,

“timestamp”: “2019-07-01T13:00:00.000Z”,

“event”: {

“hour”: “13”,

“count”: 3550

}

},

{

“version”: “v1”,

“timestamp”: “2019-07-01T14:00:00.000Z”,

“event”: {

“hour”: “14”,

“count”: 3613

}

},

{

“version”: “v1”,

“timestamp”: “2019-07-01T15:00:00.000Z”,

“event”: {

“hour”: “15”,

“count”: 3436

}

},

{

“version”: “v1”,

“timestamp”: “2019-07-01T16:00:00.000Z”,

“event”: {

“hour”: “16”,

“count”: 1023

}

},

{

“version”: “v1”,

“timestamp”: “2019-07-01T17:00:00.000Z”,

“event”: {

“hour”: “17”,

“count”: 324

}

},

{

“version”: “v1”,

“timestamp”: “2019-07-01T18:00:00.000Z”,

“event”: {

“hour”: “18”,

“count”: 317

}

},

{

“version”: “v1”,

“timestamp”: “2019-07-01T19:00:00.000Z”,

“event”: {

“hour”: “19”,

“count”: 298

}

},

{

“version”: “v1”,

“timestamp”: “2019-07-01T20:00:00.000Z”,

“event”: {

“hour”: “20”,

“count”: 261

}

},

{

“version”: “v1”,

“timestamp”: “2019-07-01T21:00:00.000Z”,

“event”: {

“hour”: “21”,

“count”: 210

}

},

{

“version”: “v1”,

“timestamp”: “2019-07-01T22:00:00.000Z”,

“event”: {

“hour”: “22”,

“count”: 172

}

},

{

“version”: “v1”,

“timestamp”: “2019-07-01T23:00:00.000Z”,

“event”: {

“hour”: “23”,

“count”: 121

}

}

]

Anyone who can help me?

Hi Scoffi,

I did understand your issues well . Do you mean the same query on the same dataset is producing different results?

If you can explain your issue with the below details that will be great to help you with this issue.

  1. Sample data on which you are running the query.

  2. Expected output of the query.

  3. The actual output of the query.

Thanks,

Vaibhav

NOPE,I meaned i cannot use spatial filter .

when i querying with the spatial filer , i did not get any result,just the [].But yesterday it was fine.

Vaibhav Vaibhav vaibhav@imply.io于2019年10月30日 周三20:47写道:

Hi Scoffi,
As per https://druid.apache.org/docs/latest/development/geo.html

But the spatialDim is the demendion’s name.The name is indeed coordinates.

Siva Mannem siva.mannem@imply.io于2019年10月31日 周四01:48写道:

But the spatialDim is not the demendion’s name.The name is indeed coordinates.

scoffi Michaeal weitianpei@gmail.com于2019年10月31日 周四09:23写道:

Hi Scoffi,
My Bad. Apologize for it. You are right. Your dimension name is coordinates.

Is it possible for you to try couple of things like the following to clarify the doubt that this is not data related issue ?