Hi! I have multiple datasources all of which I ne...
# best-practices
a
Hi! I have multiple datasources all of which I need to load into BigQuery, each datasource to its own BQ dataset. In pipelinewise target schema (target dataset in BQ) is configured in the same config file as tap. In Meltano it seems that I have to create
target-bigquery-something
for each dataset with overwritten
default_target_schema
I don't like that, because it increases complexity in my opinion. Is it the best way to configure EL in Meltano? Or am I missing something?
a
Meltano has a special environment variable which passes a "load schema" from the tap to the target. For instance, this would be
tap_github
for tap-github. I'm not at my computer to find the exact docs link, but you might be able to find more info searching "load schema" in the docs.
Let me know if this helps! :)
a
I found the docs. Seems to be exactly what I need, thanks!
a
Glad to hear it. Thanks!
a
@aaronsteers is it possible to override
load_schema
in environment layer? does not seem to work for me
use case: due to historical reasons one of the datasources have very specific target schema in prod env
a
For a single target? Is this because you want the same target schema for each tap, or you just want it to be different from the default mapping? Or is it that the target doesn't seem to do the auto-schema names as expected? Would be helpful to better understand the use case. Thanks.
a
The setup I need: dev: • mongodb_eu -> dev_raw_mongo_eu • mongodb_bra -> dev_raw_mongo_bra prod: • mongodb_eu -> very_specific_historical_name • mognodb_bra -> raw_mongo_bra
I was hoping to override
load_schema
in prod environment for _eu
Oh, so sorry. I had a typo in plugin name in prod environment config
Everything works as expected!
a
Really? Nice!
Was going to post this: Unfortunately, I don't think we have a documented way as of now to perform more advanced mappings and expressions. For this level of specificity, you might need to use the inherits_from to create copies of the target definition. You may alternatively be able to use a schema mapping config if the target supports that feature.
Specifically, complex expressions inline are a little tricky as of now. But if you've gotten it working, that's great!
Please do feel free to open an issue in our tracker if you find you need more precise control.
a
So far it seems to do the trick. And I feel that approach is quite flexible. Thanks again!