Hello, I'm using custom tap/mapper/targets to rep...
# troubleshooting
f
Hello, I'm using custom tap/mapper/targets to replicate our Postgres database to Snowflake. We're not using off-the-shelf plugins because they were too slow for our use-cases. Now, >90% of our time is spent serializing/deserializing JSON. I'd like to give
BATCH
messages a try, but the doc say it's not supported by mappers. I'm not sure why, because from
singer_sdk
it seems like my
InlineMapper
can override the
map_batch_message
method. So is it really impossible to do, or can I give it a shot?
e
You can give it a shot. The main obstacle is that mappers work on the Singer stream message-by-message, so if you need to transform records in a BATCH sync, you'll need to read the file, map it, then write the records back to batch. So, I would imagine you lose some of the benefits of BATCH mode that way.
You could of course also try writing a custom mapper that does not need to process records individually
f
Thanks, I'm gonna try. My mapper runs conditionally based on the stream, which means I can often skip it based on the
stream
property of the
BATCH
message!