-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mappers): Stream name can now be accessed in stream maps (#2699)
* Add __stream_name__ as builtin variable for transform * Test other built-in variables * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add docs * Use markdown tables * Update table descriptions --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Edgar Ramírez Mondragón <[email protected]> Co-authored-by: Edgar Ramírez-Mondragón <[email protected]>
- Loading branch information
1 parent
2be3f09
commit 702c0db
Showing
6 changed files
with
73 additions
and
20 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{"type":"STATE","value":{}} | ||
{"type":"SCHEMA","stream":"mystream","schema":{"type":"object","properties":{"email":{"type":["string","null"]}}},"key_properties":[]} | ||
{"type":"RECORD","stream":"mystream","record":{"email":"[email protected]"},"time_extracted":"2022-01-01T00:00:00+00:00"} | ||
{"type":"RECORD","stream":"mystream","record":{"email":"[email protected]"},"time_extracted":"2022-01-01T00:00:00+00:00"} | ||
{"type":"RECORD","stream":"mystream","record":{"email":"[email protected]"},"time_extracted":"2022-01-01T00:00:00+00:00"} | ||
{"type":"STATE","value":{"bookmarks":{"mystream":{}}}} |
6 changes: 6 additions & 0 deletions
6
tests/snapshots/mapped_stream/builtin_variable_stream_name.jsonl
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,6 @@ | ||
{"type":"STATE","value":{}} | ||
{"type":"SCHEMA","stream":"mystream","schema":{"properties":{"email":{"type":["string"]},"count":{"type":["integer","null"]},"user":{"properties":{"id":{"type":["integer","null"]},"sub":{"properties":{"num":{"type":["integer","null"]},"custom_obj":{"type":["string","null"]}},"type":["object","null"]},"some_numbers":{"items":{"type":["number"]},"type":["array","null"]}},"type":["object","null"]},"source_table":{"type":["string","null"]}},"type":"object","required":["email"]},"key_properties":[]} | ||
{"type":"RECORD","stream":"mystream","record":{"email":"[email protected]","count":21,"user":{"id":1,"sub":{"num":1,"custom_obj":"obj-hello"},"some_numbers":[3.14,2.718]},"source_table":"mystream"},"time_extracted":"2022-01-01T00:00:00+00:00"} | ||
{"type":"RECORD","stream":"mystream","record":{"email":"[email protected]","count":13,"user":{"id":2,"sub":{"num":2,"custom_obj":"obj-world"},"some_numbers":[10.32,1.618]},"source_table":"mystream"},"time_extracted":"2022-01-01T00:00:00+00:00"} | ||
{"type":"RECORD","stream":"mystream","record":{"email":"[email protected]","count":19,"user":{"id":3,"sub":{"num":3,"custom_obj":"obj-hello"},"some_numbers":[1.414,1.732]},"source_table":"mystream"},"time_extracted":"2022-01-01T00:00:00+00:00"} | ||
{"type":"STATE","value":{"bookmarks":{"mystream":{}}}} |
6 changes: 6 additions & 0 deletions
6
tests/snapshots/mapped_stream/builtin_variable_underscore.jsonl
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,6 @@ | ||
{"type":"STATE","value":{}} | ||
{"type":"SCHEMA","stream":"mystream","schema":{"type":"object","properties":{"email":{"type":["string","null"]}}},"key_properties":[]} | ||
{"type":"RECORD","stream":"mystream","record":{"email":"[email protected]"},"time_extracted":"2022-01-01T00:00:00+00:00"} | ||
{"type":"RECORD","stream":"mystream","record":{"email":"[email protected]"},"time_extracted":"2022-01-01T00:00:00+00:00"} | ||
{"type":"RECORD","stream":"mystream","record":{"email":"[email protected]"},"time_extracted":"2022-01-01T00:00:00+00:00"} | ||
{"type":"STATE","value":{"bookmarks":{"mystream":{}}}} |