abhishekagarwal87 commented on code in PR #15455:
URL: https://github.com/apache/druid/pull/15455#discussion_r1410160949
##########
docs/querying/filters.md:
##########
@@ -450,6 +450,43 @@ Note that it is often more optimal to use a like filter
instead of a regex for s
{ "type": "regex", "dimension": "someColumn", "pattern": ^50.* }
```
+## Array contains element filter
+
+The `arrayContainsElement` filter is for checking if an `ARRAY` contains a
specific element, but can match against any type of column with scalar columns
being treated as single element arrays.
Review Comment:
```suggestion
The `arrayContainsElement` filter is for checking if an `ARRAY` contains a
specific element, but can also match against any type of column. When matching
against scalar columns, scalar columns are treated as single-element arrays.
```
##########
docs/querying/filters.md:
##########
@@ -450,6 +450,43 @@ Note that it is often more optimal to use a like filter
instead of a regex for s
{ "type": "regex", "dimension": "someColumn", "pattern": ^50.* }
```
+## Array contains element filter
+
+The `arrayContainsElement` filter is for checking if an `ARRAY` contains a
specific element, but can match against any type of column with scalar columns
being treated as single element arrays.
+
+| Property | Description | Required |
+| -------- | ----------- | -------- |
+| `type` | Must be "arrayContainsElement".| Yes |
+| `column` | Input column or virtual column name to filter. | Yes |
+| `elementMatchValueType` | String specifying the type of element value to
match. For example `STRING`, `LONG`, `DOUBLE`, `FLOAT`, `ARRAY<STRING>`,
`ARRAY<LONG>`, or any other Druid type. The `elementMatchValueType` determines
how Druid interprets the `elementMatchValue` to assist in converting to the
type of elements contained in the matched `column`. | Yes |
+| `elementMatchValue` | Array element value to match, including null. | Yes |
Review Comment:
```suggestion
| `elementMatchValue` | The value to is matched against the elements of
`column`. This value can be null. | Yes |
```
my phrasing might not be best here.
##########
docs/querying/filters.md:
##########
@@ -450,6 +450,43 @@ Note that it is often more optimal to use a like filter
instead of a regex for s
{ "type": "regex", "dimension": "someColumn", "pattern": ^50.* }
```
+## Array contains element filter
+
+The `arrayContainsElement` filter is for checking if an `ARRAY` contains a
specific element, but can match against any type of column with scalar columns
being treated as single element arrays.
+
+| Property | Description | Required |
+| -------- | ----------- | -------- |
+| `type` | Must be "arrayContainsElement".| Yes |
+| `column` | Input column or virtual column name to filter. | Yes |
Review Comment:
```suggestion
| `column` | Input column or virtual column name to filter on. | Yes |
```
##########
docs/querying/filters.md:
##########
@@ -450,6 +450,43 @@ Note that it is often more optimal to use a like filter
instead of a regex for s
{ "type": "regex", "dimension": "someColumn", "pattern": ^50.* }
```
+## Array contains element filter
+
+The `arrayContainsElement` filter is for checking if an `ARRAY` contains a
specific element, but can match against any type of column with scalar columns
being treated as single element arrays.
+
+| Property | Description | Required |
+| -------- | ----------- | -------- |
+| `type` | Must be "arrayContainsElement".| Yes |
+| `column` | Input column or virtual column name to filter. | Yes |
+| `elementMatchValueType` | String specifying the type of element value to
match. For example `STRING`, `LONG`, `DOUBLE`, `FLOAT`, `ARRAY<STRING>`,
`ARRAY<LONG>`, or any other Druid type. The `elementMatchValueType` determines
how Druid interprets the `elementMatchValue` to assist in converting to the
type of elements contained in the matched `column`. | Yes |
+| `elementMatchValue` | Array element value to match, including null. | Yes |
+
+### Example: equivalent of `WHERE ARRAY_CONTAINS(someArrayColumn, 'hello')`
Review Comment:
I feel a language like below is better
```suggestion
### Example: to filter rows where someArrayColumn has any element that is
equal to 'hello'
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]