SetIntersection / List Layer
Compute the set intersection between two variable-length lists. Returns a list containing elements that exist in both lists. Similar to Python's set intersection operation or SQL's INTERSECT.
Mathematical definition: For sets A and B, the intersection A ∩ B is defined as: In other words, elements that are in both A and B.
Example transformation:
left_list | right_list | intersection |
---|---|---|
[1, 2, 3, 4] | [2, 4, 5] | [2, 4] |
[a, b, c] | [b, d] | [b] |
[1, 1, 2, 3] | [1, 2] | [1, 2] |
[x, y] | [] | [] |
[1, null, 3] | [1, 2] | [1] |
Properties:
- Commutative:
- Associative:
- Identity: (where U is the universal set)
- Null set:
Common applications:
- Finding common features between versions
- Identifying shared permissions
- Detecting overlapping categories
- Finding matching elements
- Computing common attributes
- Analyzing shared characteristics
Note: Duplicates in input lists are removed (set semantics). Null values are ignored. Order of elements in result is not guaranteed. Lists can have different lengths.
SelectLeft
columnThe first list column (SelectLeft
) for intersection. Examples:
- User A permissions: [read, write, execute]
- Product features: [f1, f2, f3]
- Category tags: [electronics, computers, phones] Lists can have different lengths. Duplicates allowed but treated as single elements.
SelectRight
columnThe second list column (SelectRight
) for intersection. Examples:
- User B permissions: [read, execute]
- Required features: [f1, f3]
- Search tags: [computers, software] Lists can have different lengths. Duplicates allowed but treated as single elements.
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.