mirror of https://github.com/apache/druid.git
Update filters.md (#14917)
This commit is contained in:
parent
d6565f46b0
commit
8885805bb3
|
@ -80,19 +80,19 @@ Druid's SQL planner uses the equality filter by default instead of selector filt
|
||||||
### Example: equivalent of `WHERE someColumn = 'hello'`
|
### Example: equivalent of `WHERE someColumn = 'hello'`
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{ "type": "equality", "column": "someColumn", "matchValueType": "STRING", "matchValue": "hello" }
|
{ "type": "equals", "column": "someColumn", "matchValueType": "STRING", "matchValue": "hello" }
|
||||||
```
|
```
|
||||||
|
|
||||||
### Example: equivalent of `WHERE someNumericColumn = 1.23`
|
### Example: equivalent of `WHERE someNumericColumn = 1.23`
|
||||||
|
|
||||||
```json
|
```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]`
|
### Example: equivalent of `WHERE someArrayColumn = ARRAY[1, 2, 3]`
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{ "type": "equality", "column": "someArrayColumn", "matchValueType": "ARRAY<LONG>", "matchValue": [1, 2, 3] }
|
{ "type": "equals", "column": "someArrayColumn", "matchValueType": "ARRAY<LONG>", "matchValue": [1, 2, 3] }
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -160,8 +160,8 @@ Note that the column comparison filter converts all values to strings prior to c
|
||||||
{
|
{
|
||||||
"type": "and",
|
"type": "and",
|
||||||
"fields": [
|
"fields": [
|
||||||
{ "type": "equality", "column": "someColumn", "matchValue": "a", "matchValueType": "STRING" },
|
{ "type": "equals", "column": "someColumn", "matchValue": "a", "matchValueType": "STRING" },
|
||||||
{ "type": "equality", "column": "otherColumn", "matchValue": 1234, "matchValueType": "LONG" },
|
{ "type": "equals", "column": "otherColumn", "matchValue": 1234, "matchValueType": "LONG" },
|
||||||
{ "type": "null", "column": "anotherColumn" }
|
{ "type": "null", "column": "anotherColumn" }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -180,8 +180,8 @@ Note that the column comparison filter converts all values to strings prior to c
|
||||||
{
|
{
|
||||||
"type": "or",
|
"type": "or",
|
||||||
"fields": [
|
"fields": [
|
||||||
{ "type": "equality", "column": "someColumn", "matchValue": "a", "matchValueType": "STRING" },
|
{ "type": "equals", "column": "someColumn", "matchValue": "a", "matchValueType": "STRING" },
|
||||||
{ "type": "equality", "column": "otherColumn", "matchValue": 1234, "matchValueType": "LONG" },
|
{ "type": "equals", "column": "otherColumn", "matchValue": 1234, "matchValueType": "LONG" },
|
||||||
{ "type": "null", "column": "anotherColumn" }
|
{ "type": "null", "column": "anotherColumn" }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -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
|
Given a multi-value STRING row with values `['a', 'b', 'c']`, a filter such as
|
||||||
|
|
||||||
```json
|
```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.
|
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.
|
||||||
|
|
||||||
|
@ -724,13 +724,13 @@ Given a multi-value STRING row with values `['a', 'b', 'c']`, and filter such as
|
||||||
"type": "and",
|
"type": "and",
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"type": "equality",
|
"type": "equals",
|
||||||
"column": "someMultiValueColumn",
|
"column": "someMultiValueColumn",
|
||||||
"matchValueType": "STRING",
|
"matchValueType": "STRING",
|
||||||
"matchValue": "a"
|
"matchValue": "a"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "equality",
|
"type": "equals",
|
||||||
"column": "someMultiValueColumn",
|
"column": "someMultiValueColumn",
|
||||||
"matchValueType": "STRING",
|
"matchValueType": "STRING",
|
||||||
"matchValue": "b"
|
"matchValue": "b"
|
||||||
|
@ -754,7 +754,7 @@ the "regex" filter) the numeric column values will be converted to strings durin
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"type": "equality",
|
"type": "equals",
|
||||||
"dimension": "myFloatColumn",
|
"dimension": "myFloatColumn",
|
||||||
"matchValueType": "FLOAT",
|
"matchValueType": "FLOAT",
|
||||||
"value": 10.1
|
"value": 10.1
|
||||||
|
@ -811,7 +811,7 @@ If you want to interpret the timestamp with a specific format, timezone, or loca
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"type": "equality",
|
"type": "equals",
|
||||||
"dimension": "__time",
|
"dimension": "__time",
|
||||||
"matchValueType": "LONG",
|
"matchValueType": "LONG",
|
||||||
"value": 124457387532
|
"value": 124457387532
|
||||||
|
|
Loading…
Reference in New Issue