julian_knight
08/31/2020, 8:30 PMjulian_knight
08/31/2020, 8:30 PMdbt-tap-gitlab. I understand why it works this way based on the previous design goals of Meltano. However I'm not sure it's the best idea to use them from a maintainability perspective:
• the transformed tables the plugin generates are hidden in a plugin and not evident by looking at the code. The dbt project isn't just a transform step; it also acts as documentation for what data is ready to be consumed
• the conventions of the plugin may not match those of your organization (think column names, data types, etc.)
• you don't have control over the materialization method (at least as far as I could tell), you just get whatever the plugin author picked
• you don't have control over which models get generated (at least as far as I could tell)
Based on this, we decided to go through the process of implementing every model in dbt ourselves. This acts as an indication that the model has been validated and is ready for consumption.julian_knight
08/31/2020, 8:32 PMmeltano elt --transform=run runs the entire my_meltano_project dbt project, even (possibly expensive) transforms that were not effected by the EL pipeline.
To work around this, we deleted my_meltano_project and made model subfolders that matched the pipeline name. Then we use the DBT_MODELS env var to override the models to be run by setting it to the pipeline name. For example, DBT_MODELS=gitlab meltano elt --job_id=gitlab --transform=run tap-gitlab target-postgres. This is effectively the same as dbt run -m gitlab.julian_knight
08/31/2020, 8:32 PMmeltano elt --transform=run, but not seeds, snapshots, etc. We are working around this by running meltano invoke db seed when seeds change, and having our scheduler execute meltano invoke dbt snapshot after each meltano elt.julian_knight
08/31/2020, 8:42 PM--transform as an argument to elt - there are actually two data destinations here, but we only specify one. Consider this (common, IMO) use case:
- use tap-mixpanel to put all raw data on s3, where it is cheap to store and query with Athena
- use dbt to aggregate the data from Athena into more managable amounts of useful data to be stored in the data warehouse
Conceptually, there are actually 3 data sources here:
Mixpanel API -> S3/Athena -> Postgres
As far as I can tell, Meltano tries to use the target to determine the destination database that dbt should use, but in this situation the transform destination database is different from it's source. The workaround here I think is to run dbt manually with meltano invoke dbt, but we aren't quite there yet so I don't have the exact command.
It might make more sense to invoke this command with 3 arguments? e.g. something like meltano elt [extractor] [loader] [transformer] or to invoke them as 2 separate commands, e.g. meltano el and meltano tandrew_stewart
08/31/2020, 9:38 PMandrew_stewart
08/31/2020, 9:47 PMandrew_stewart
09/01/2020, 1:12 AMandrew_stewart
09/01/2020, 1:13 AMjulian_knight
09/01/2020, 1:14 AMandrew_stewart
09/01/2020, 1:14 AMandrew_stewart
09/01/2020, 1:16 AME(*) -> L(s3) -> T(s3) -> E(s3) -> L(dw) -> T(dw)julian_knight
09/01/2020, 1:19 AMmeltano elt --tranform=run tap-mixpanel target-s3 with some sort of configuration passed to DBT so it knows where to transform, or meltano elt --tranform=skip tap-mixpanel target-s3 followed by manually invoking meltano invoke dbt run. If we were to do the second pipeline as a meltan elt command, what would you pass as the extractor and loader? I suppose it could be tap-s3 to target-postgres?julian_knight
09/01/2020, 1:21 AMandrew_stewart
09/01/2020, 2:00 AMandrew_stewart
09/01/2020, 2:00 AMadam_roderick
09/01/2020, 2:51 PMadam_roderick
09/01/2020, 2:52 PMdouwe_maan
09/01/2020, 3:39 PMdouwe_maan
09/01/2020, 3:48 PMDBT_MODELS ! That's exactly what it's there for 🙂 It will also have to be documented explicitly.
3. Do you think it would make sense for Meltano to run seeds and/or snapshots automatically?
4. As you've found, Meltano currently assumes that the loading and transformation-target database are the same. If that's not always going to be the case, we should definitely support that explicitly and not make it feel like you're fighting against the tool. Having meltano elt take an explicit transformer argument is related to what I was pondering here: https://gitlab.com/meltano/meltano/-/issues/2300#note_400291810. I'd love to hear your thoughts there or in a new issue!douwe_maan
09/01/2020, 3:59 PMI appreciate that meltano positions itself as a single point of entry to 1) extraction, 2) loading, 3) transformations (dbt), and 4) orchestrations (airflow), but in doing so I also see the potential for the meltano governed workflow to rigidly adhere to that exact sequence without flexibility towards things like multi-step loading sequences.@andrew_stewart We like "Convention over Configuration" for common scenarios, but flexibility is also a priority, as evidenced by the fact that @julian_knight was able to tweak some of the unwanted default behavior using env vars and explicit
meltano invoke calls 🙂
Meltano is built for and by its community of users, so if multi-step loading sequences are something our users are going to want, we'll find a way to support it and still make it feel intuitive and consistent with the rest of Meltano!
The intention is for Meltano and your team's Meltano project to stand the test of time and evolve with your team and the data space, in terms of features and approaches it supports, and specific plugins it integrates with, so whatever it can do today should not be seen as a limit on what it may be able to do tomorrow.julian_knight
09/01/2020, 4:23 PMTransform plugins are primarily useful in combination with Model and Dashboard plugins, so that a new Meltano user can go from data to dashboard in moments, just by adding the relevant plugins and opening up the UI. They're much less relevant to data teams like yours, who want more control over their transformations.That's what I figured.
Do you think it would make sense for Meltano to run seeds and/or snapshots automatically?Seeds, no. They change infrequently enough that it should probably be a manual task. Snapshots perhaps, although I am not sure how to associate a snapshot with a subset of dbt models to run.
HavingI like it! Added a comment: https://gitlab.com/meltano/meltano/-/issues/2300#note_405516523 🙂take an explicit transformer argument is related to what I was pondering here:meltano elt
julian_knight
09/01/2020, 4:25 PMThen Spectrum inside of Redshift to expose the data into Redshift.@adam_roderick Thanks! I wasn't familiar with Spectrum. I love the elegance of that pipeline. Perhaps we will start migrating to RedShift.
julian_knight
09/01/2020, 4:30 PMandrew_stewart
09/01/2020, 5:43 PMmeltano as it currently exists rather than speculating on what it should be. I myself am just trying to learn how it should/could be used for this kind of use case before pretending to know what it should be doing differently 😉andrew_stewart
09/01/2020, 5:44 PMdouwe_maan
09/01/2020, 7:12 PM[Migrations] could be something Meltano comes with out-of-the-box support for in the future, given I think it's a pretty common use case.@julian_knight Very interesting idea!
meltano add migrator alembic has a nice ring to it 😉 I assume it's on your list of things to create issues for 😉julian_knight
09/01/2020, 9:32 PMdouwe_maan
09/01/2020, 9:33 PM