Skip to content

Commit

Permalink
Update filters.md (#14917)
Browse files Browse the repository at this point in the history
  • Loading branch information
benkrug authored Aug 28, 2023
1 parent d6565f4 commit 8885805
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions docs/querying/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@ Druid's SQL planner uses the equality filter by default instead of selector filt
### Example: equivalent of `WHERE someColumn = 'hello'`

```json
{ "type": "equality", "column": "someColumn", "matchValueType": "STRING", "matchValue": "hello" }
{ "type": "equals", "column": "someColumn", "matchValueType": "STRING", "matchValue": "hello" }
```

### Example: equivalent of `WHERE someNumericColumn = 1.23`

```json
{ "type": "equality", "column": "someNumericColumn", "matchValueType": "DOUBLE", "matchValue": 1.23 }
{ "type": "equals", "column": "someNumericColumn", "matchValueType": "DOUBLE", "matchValue": 1.23 }
```

### Example: equivalent of `WHERE someArrayColumn = ARRAY[1, 2, 3]`

```json
{ "type": "equality", "column": "someArrayColumn", "matchValueType": "ARRAY<LONG>", "matchValue": [1, 2, 3] }
{ "type": "equals", "column": "someArrayColumn", "matchValueType": "ARRAY<LONG>", "matchValue": [1, 2, 3] }
```


Expand Down Expand Up @@ -160,8 +160,8 @@ Note that the column comparison filter converts all values to strings prior to c
{
"type": "and",
"fields": [
{ "type": "equality", "column": "someColumn", "matchValue": "a", "matchValueType": "STRING" },
{ "type": "equality", "column": "otherColumn", "matchValue": 1234, "matchValueType": "LONG" },
{ "type": "equals", "column": "someColumn", "matchValue": "a", "matchValueType": "STRING" },
{ "type": "equals", "column": "otherColumn", "matchValue": 1234, "matchValueType": "LONG" },
{ "type": "null", "column": "anotherColumn" }
]
}
Expand All @@ -180,8 +180,8 @@ Note that the column comparison filter converts all values to strings prior to c
{
"type": "or",
"fields": [
{ "type": "equality", "column": "someColumn", "matchValue": "a", "matchValueType": "STRING" },
{ "type": "equality", "column": "otherColumn", "matchValue": 1234, "matchValueType": "LONG" },
{ "type": "equals", "column": "someColumn", "matchValue": "a", "matchValueType": "STRING" },
{ "type": "equals", "column": "otherColumn", "matchValue": 1234, "matchValueType": "LONG" },
{ "type": "null", "column": "anotherColumn" }
]
}
Expand Down Expand Up @@ -709,7 +709,7 @@ All filters return true if any one of the dimension values is satisfies the filt
Given a multi-value STRING row with values `['a', 'b', 'c']`, a filter such as

```json
{ "type": "equality", "column": "someMultiValueColumn", "matchValueType": "STRING", "matchValue": "b" }
{ "type": "equals", "column": "someMultiValueColumn", "matchValueType": "STRING", "matchValue": "b" }
```
will successfully match the entire row. This can produce sometimes unintuitive behavior when coupled with the implicit UNNEST functionality of Druid [GroupBy](./groupbyquery.md) and [TopN](./topnquery.md) queries.

Expand All @@ -724,13 +724,13 @@ Given a multi-value STRING row with values `['a', 'b', 'c']`, and filter such as
"type": "and",
"fields": [
{
"type": "equality",
"type": "equals",
"column": "someMultiValueColumn",
"matchValueType": "STRING",
"matchValue": "a"
},
{
"type": "equality",
"type": "equals",
"column": "someMultiValueColumn",
"matchValueType": "STRING",
"matchValue": "b"
Expand All @@ -754,7 +754,7 @@ the "regex" filter) the numeric column values will be converted to strings durin

```json
{
"type": "equality",
"type": "equals",
"dimension": "myFloatColumn",
"matchValueType": "FLOAT",
"value": 10.1
Expand Down Expand Up @@ -811,7 +811,7 @@ If you want to interpret the timestamp with a specific format, timezone, or loca

```json
{
"type": "equality",
"type": "equals",
"dimension": "__time",
"matchValueType": "LONG",
"value": 124457387532
Expand Down

0 comments on commit 8885805

Please sign in to comment.