-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: LIFO option to dedupe processor (#148)
Signed-off-by: Jem Davies <[email protected]>
- Loading branch information
1 parent
bf03539
commit dc98f1c
Showing
4 changed files
with
158 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
pipeline: | ||
processors: | ||
- dedupe: | ||
cache: local | ||
key: ${! json("user_uuid") }:${! json("month") } | ||
strategy: LIFO | ||
|
||
cache_resources: | ||
- label: local | ||
memory: | ||
default_ttl: 1m | ||
|
||
tests: | ||
- name: de-duplicate LIFO across batches | ||
input_batches: | ||
- | ||
- content: '{"json":"data-1","month":"2024-01-01","user_uuid":"id-1"}' | ||
- content: '{"json":"data-1","month":"2024-01-01","user_uuid":"id-2"}' | ||
- content: '{"json":"data-1","month":"2024-01-01","user_uuid":"id-3"}' | ||
- content: '{"json":"data-1","month":"2024-01-01","user_uuid":"id-4"}' | ||
- content: '{"json":"updated-data-1","month":"2024-01-01","user_uuid":"id-1"}' | ||
- | ||
- content: '{"json":"data-2","month":"2024-02-01","user_uuid":"id-1"}' | ||
- content: '{"json":"data-2","month":"2024-02-01","user_uuid":"id-2"}' | ||
- content: '{"json":"data-2","month":"2024-02-01","user_uuid":"id-3"}' | ||
- content: '{"json":"data-2","month":"2024-02-01","user_uuid":"id-4"}' | ||
- content: '{"json":"updated-data-2","month":"2024-02-01","user_uuid":"id-1"}' | ||
output_batches: | ||
- | ||
- json_equals: {"user_uuid": "id-2", "month": "2024-01-01", "json": "data-1"} | ||
- json_equals: {"user_uuid": "id-3", "month": "2024-01-01", "json": "data-1"} | ||
- json_equals: {"user_uuid": "id-4", "month": "2024-01-01", "json": "data-1"} | ||
- json_equals: {"user_uuid": "id-1", "month": "2024-01-01", "json": "updated-data-1"} | ||
- | ||
- json_equals: {"user_uuid": "id-2", "month": "2024-02-01", "json": "data-2"} | ||
- json_equals: {"user_uuid": "id-3", "month": "2024-02-01", "json": "data-2"} | ||
- json_equals: {"user_uuid": "id-4", "month": "2024-02-01", "json": "data-2"} | ||
- json_equals: {"user_uuid": "id-1", "month": "2024-02-01", "json": "updated-data-2"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters