Contains / Array Layer
Check if fixed-length arrays contain a specific value. Similar to Python's in operator or JavaScript's includes(). Returns a boolean column indicating whether each array contains the specified item.
Example transformation (arrays of length 3):
arrays | contains_3 |
---|---|
[1, 3, 5] | true |
[2, 4, 6] | false |
[3, 3, 7] | true |
[null, 3, null] | true |
Common applications:
- Tag presence checking
- Category membership
- Feature detection
- Value verification
- Set membership testing
Note: Arrays must have the same fixed length across all rows. Type-sensitive comparison. Returns null if array contains all nulls.
Table
0
0
Table
Select
columnThe fixed-length array column to search. Supports various array types:
- Numeric: [1, 2, 3]
- String: [red, blue, green]
- Boolean: [true, false, true]
- Dates: [2024-01-01, 2024-02-01, 2024-03-01] All arrays must have the same length. Mixed types not supported.
Item
stringThe value to search for. Must match array type. Examples:
- Numeric: 42
- String: blue
- Boolean: true
- Date: 2024-01-31
- Time: 15:30:00
AsColumn
nameName for the new column. If not provided, the system generates a unique name. If AsColumn
matches an existing column, the existing column is replaced. The name should follow valid column naming conventions.