Hello! I'm currently using target-bigquery with a ...
# singer-targets
a
Hello! I'm currently using target-bigquery with a tap that includes periods in the property names (e.g.
campaign.id
is the name of the column). Since bigquery doesn't allow column names to have periods, I haven't been able to load the data. Is there a way to replace a period with an underscore across all properties before loading to the target? I've tried to use stream-maps, but they're not playing nicely with the periods. I'd also love to not have to add a stream map for every column in my tap, if there's a way to use a function for all the properties.
Copy code
config:
        stream_maps:
          campaigns:
            campaign_id: _['campaign.id']
            campaign.id: __NULL__
v
You could make your own mapper and put it inbetween and then write the code to do that. You could also fork the tap and put the logic in for columns to do what you're after
p
I customized my target. You can customize your transform_column_name method to replace your char: name.replace(".","_"). also make sure that you have "apply_transforms" on true where necessary in code (I had to add an apply transform to create_table method for instance).
1
a
Thanks for the responses to this question! I was hoping to use an open source tap, and not fork it to make edits. I went ahead and added a mapper, but I had to declare each column individually (to remove the period). Do y'all know if there might be a way to do that in a function for all column names when setting up a mapper?
p
Yeah we had the same issue. Hence the need for the customization.
It's a quick addition. Then you can run --custom to provide meltano with your custom plugin.