Remove¶
Name | Mandatory | Description | Default | Type |
---|---|---|---|---|
⬅️ Input |
Any input is ignored. | None |
||
Output ➡️ |
Output is the filtered sequence. | [Any] |
||
From |
No | The name of the sequence variable to edit in place. | none |
Var([Any]) |
Join |
No | Other columns to join sort/filter using the input (they must be of the same length). | none |
None Var([Any]) [Var([Any])] |
Predicate |
No | The shards to use as predicate, if true the item will be popped from the sequence. | none |
Shard [Shard] |
Unordered |
No | Turn on to remove items very quickly but will not preserve the sequence items order. | false |
Bool |
Removes all elements from a sequence that match the given condition. Can also take these matched indices and remove corresponding elements from a joined sequence.
Details¶
This shard can also remove elements with the corresponding indices from a joined sequence (passed via the Join:
parameter). Remember, Remove
doesn't apply the Predicate
conditions to the joined sequence, but only removes corresponding elements. For this to work both the sequences must have the same length.
Note
Think of this as the Shards equivalent of a relational database inner join. The main sequence and the joined sequence can be thought of as columns from two different tables inner joined over indices equality. So that the changes in elements of one sequence (rows in the first table) can be propagated to the corresponding elements of the joined sequence (corresponding rows in the joined table).
In this case the operation is deletion of selected elements (selected rows) from one sequence (table) leading to deletion of corresponding elements (connected rows) of the joined sequence (joined table).
The Predicate
parameter can take any conditional/logical expression or combination of shards that will result in assertion that can be tested on the sequence elements.
The Unordered
parameter can be set to true
if you need to make the removal process faster, but then the order of the remaining elements in the resulting sequence elements may not be preserved. By default, this order is preserved.
Remove
works only on sequences.
Examples¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
[info] [sample-wire] output: [10 20]
[info] [sample-wire] .seq1: [10 20]
[info] [sample-wire] .seq2: [10 30]
[info] [sample-wire] .seqJ: [100 300]
[info] [sample-wire] .seq3: [[40 50] [30 40]]