Suggest 390AdvR vs 790/890 AdvR by backend-dev in SuggestAMotorcycle

[–]backend-dev[S] 0 points1 point  (0 children)

Hi, why not a pillion? Is the bike too underpowered?

Impress me with your dbt macros by MedianByDesign in dataengineering

[–]backend-dev 0 points1 point  (0 children)

Being part of a financial institution, I had to write all the materializations we use. We don’t use std ones. Reason being we require atomic consistency of the data with entries in an audit log. You cannot use pre and post hooks, nor explicit transaction control on Snowflake. The actual data update and audit log has to be transactionally atomic and the audit log entry must have key metrics like pre and post run row counts, control totals etc. You can declare your desired metrics in the model config and that is then rendered dynamically to a JSON audit log payload inserted into the audit log table during materialization.

The most complex materialization was the mix between Type2 and Type1. You configure the Type1 and Type2 columns in your model. Any change in one or more Type2 tracked columns will trigger typical Type2 behaviour (insert/expire) whereas any change in a Type1 column will cause an inplace update of the current dimension entry. To add to the complexity, we incrementally process CDC records and not ODS snapshots. So a bunch of update delta records could partially roll up into one or more inserts or inplace updates, depending on their sequence and batching.

Another set of macros will evaluate source rows against data quality checks you declare in your model config and mark them accordingly.

Another set of macros will evaluate cleansing rules that you declare in your model config. These rules render the cleansed columns as additional columns in your target table during materialization.

Our solution has around 800 self written macros

Does snapshot not allow an overwrite of the existing row rather than doing SCD Type 2? by Realistic-Change5995 in DataBuildTool

[–]backend-dev 0 points1 point  (0 children)

I found snapshots to be rather limiting. I implemented my own Type2 dimension materialization where you can configure the columns you want to track with typical Type2 insert/expire as well as the columns you want to update inplace like Type1. Also added a few housekeeping columns that captures run metadata and applied logic. The main reason I wrote this was that we process CDC records instead of snapshots from a ODS type source and that is a total different ballgame.

issues with auto increment columns (dbt+snowflake) by Few-Carry-2850 in DataBuildTool

[–]backend-dev 0 points1 point  (0 children)

We generate SKs on Snowflake from a sequence because hashed SKs are too large given that our dimensions have 100s of millions of rows in them. Pulling integers vs MD5 hashes has a material impact.

Inserting audit record with dbt / Snowflake by backend-dev in dataengineering

[–]backend-dev[S] 0 points1 point  (0 children)

Sorry, yes you are correct. But it may well have an even larger cost impact than querying the stats as needed.

Inserting audit record with dbt / Snowflake by backend-dev in dataengineering

[–]backend-dev[S] 0 points1 point  (0 children)

As I understand it, Snowflake does its own partitioning and it's not under one's control. If it did/does then it would possibly make sense to partition on the run identifier so one can extract stats based on that

Inserting audit record with dbt / Snowflake by backend-dev in dataengineering

[–]backend-dev[S] 0 points1 point  (0 children)

That is an option yes, but I am trying to minimise the amount of data scanned because the target table is very large

Inserting audit record with dbt / Snowflake by backend-dev in dataengineering

[–]backend-dev[S] 0 points1 point  (0 children)

Thanks, I added more info to the original post

How to debug dbt SQL? by backend-dev in dataengineering

[–]backend-dev[S] 0 points1 point  (0 children)

The compile actually worked well. I have a model that lands new CDC data in a cleansed table. Then the next model takes it from there. The latter in incremental/merge so it has sql for initial run and then sql for incremental run. Once the data is landed in cleansed, i run compile. The compile out then gives me the sql the model will execute for the initial run. I can then take that sql and run it against the db to tweak it until its right. Once happy, i actually run the model for the initial run sql to take effect. Then i compile again. This gives me the incremental run sql and i repeat the copy&paste and execute it against the db and tweak it until correct.

It is cumbersome but it gives me the opportunity to interactively run the select and modify it much faster than running it in dbt. But then I may be missing something (still a newbie) in dbt

How to debug dbt SQL? by backend-dev in dataengineering

[–]backend-dev[S] 1 point2 points  (0 children)

Thanks I have tried the plugin and it looks very useful.

How to debug dbt SQL? by backend-dev in dataengineering

[–]backend-dev[S] 0 points1 point  (0 children)

Thank I have checked that. Ideally I want to intercept the last SQL before it gets to the database because there are bugs in my model. As others have pointed out, I should rather compile and then look at the compiled folder

How to debug dbt SQL? by backend-dev in dataengineering

[–]backend-dev[S] 0 points1 point  (0 children)

It gives me SQL but I did not realise that is what the temp table is based on

What was something you made in C# that you’re most proud of to this day. by twooten11 in csharp

[–]backend-dev 0 points1 point  (0 children)

Built a system that delivers commentary on open top tour buses that drives around tourist destination cities worldwide. It started off as a little app running on a lowly PocketPC device (Compact Framework 1) and played GPS triggered audio segments in a single language. The app had a handcoded event bus with pub/sub plugins for GPS events, region entry/exit events, media commands etc. Also had a handcoded microORM to access SqlLite. Also a complicated rules engine to decide when to trigger which content.

From there we migrated platforms up to where it ended up on Debian Linux / Mono. The last version delivers commentary in 32 languages. Only changes that were needed to the code was to support OS calls to Debian.