andrew_stewart
03/11/2022, 7:52 PMmeltano --log-level debug run tap-mongodb filter-stream target-postgres
Run invocation could not be completed as block failed: Cannot start plugin meltano-map-transformer: Executable 'meltano-map-transformer' could not be found. Mapper 'meltano-map-transformer' may not havebeen installed yet using `meltano install mapper meltano-map-transformer`, or the executable name may be incorrect.
mappers:
- name: meltano-map-transformer
variant: meltano
pip_url: git+<https://github.com/MeltanoLabs/meltano-map-transform.git>
# pip_url: meltano-map-transform
mappings:
- name: filter-stream
config:
stream_maps:
mystream:
__filter__: "'\\u0000' in record['document']"
edgar_ramirez_mondragon
03/11/2022, 7:55 PMexecutable: meltano-map-transform
, i.e.
mappers:
- name: meltano-map-transformer
variant: meltano
pip_url: git+<https://github.com/MeltanoLabs/meltano-map-transform.git>
# pip_url: meltano-map-transform
executable: meltano-map-transform
mappings:
- name: filter-stream
config:
stream_maps:
mystream:
__filter__: "'\\u0000' in record['document']"
andrew_stewart
03/11/2022, 7:56 PMedgar_ramirez_mondragon
03/11/2022, 8:03 PM"'\\u0000' in record['document']"
?andrew_stewart
03/11/2022, 8:03 PMandrew_stewart
03/11/2022, 8:04 PM\u0000
edgar_ramirez_mondragon
03/11/2022, 8:17 PMrecord['document']
a string?andrew_stewart
03/11/2022, 8:20 PMpipelinewise-tap-mongodb
), which basically treats an entire record as one field on the extractor side.. and then in target-postgres
that becomes a jsonb field.andrew_stewart
03/11/2022, 8:20 PMrecord['document']
should be at that point in time during the mapper)andrew_stewart
03/11/2022, 8:22 PM\u0000
in the meltano.yml because the yaml parser complains about “embedded null byte”andrew_stewart
03/11/2022, 8:23 PMRun invocation could not be completed as block failed: Cannot start plugin meltano-map-transformer: embedded null byte
andrew_stewart
03/11/2022, 8:23 PMedgar_ramirez_mondragon
03/11/2022, 8:28 PMandrew_stewart
03/11/2022, 8:44 PMandrew_stewart
03/11/2022, 8:45 PMedgar_ramirez_mondragon
03/11/2022, 9:02 PMandrew_stewart
03/11/2022, 9:10 PMedgar_ramirez_mondragon
03/12/2022, 12:43 AMaaronsteers
03/12/2022, 2:04 AMaaronsteers
03/12/2022, 2:07 AM(so I’m a little fuzzy on whatshould be at that point in time during the mapper)record['document']
It should be the python representation of whatever field is in the "document" property. If it is a string, you should be able to manipulate it with python string operations. If it is a node with subproperties, you would treat it as a dict object. Syntax should be basically the same as Python but not all operations are easy to perform inline.
aaronsteers
03/12/2022, 2:09 AMandrew_stewart
03/12/2022, 3:23 AMrecord
there be the property ?andrew_stewart
03/12/2022, 3:25 AMaaronsteers
03/12/2022, 6:16 PMaaronsteers
03/12/2022, 6:20 PM{ id: 1, user: { name: John } }
, you could use filter expressions like record['id'] > 0
and record['user'].get('name', None) is not None
.aaronsteers
03/12/2022, 6:25 PMmd5()
which doesn't exist as a python function in built-in libraries, but we've defined it in the SDK and passed it along to the evaluation context.
A similar function could be defined like deep_str_contains(dict_or_str, str_check)
. Probably this isn't what we'd want to build exactly, but wanted to let you know we have options to add new convenience functions.aaronsteers
03/12/2022, 6:27 PMandrew_stewart
03/23/2022, 12:43 AMaaronsteers
03/23/2022, 1:36 AMandrew_stewart
03/23/2022, 8:31 PM