Handle JSON with dbt // jinja & macros

  Рет қаралды 26,476

Kahan Data Solutions

Kahan Data Solutions

Күн бұрын

Пікірлер: 27
@KahanDataSolutions
@KahanDataSolutions 2 жыл бұрын
Get my Modern Data Essentials training (for free) & start building more reliable data architectures www.ModernDataCommunity.com
@randolphdeline309
@randolphdeline309 2 жыл бұрын
I think you just saved me weeks worth of work. I was just put in charge of flattening dozens of tables with multiple levels totaling 100s of columns and that macro is perfect.
@KahanDataSolutions
@KahanDataSolutions 2 жыл бұрын
Love to hear that!
@peytonbadura6808
@peytonbadura6808 Жыл бұрын
I had to change a couple of things to get this to work with SQL Server but this was a lifesaver! Thank you!
@KahanDataSolutions
@KahanDataSolutions Жыл бұрын
Nice! you bet
@brodericksmith8617
@brodericksmith8617 Жыл бұрын
hey there! this video is awesome! do you have any tips on how to turn a variable into a string? I'm trying to take this concept and apply it to Postgres, but i need the column names to be strings to make it work. not sure how to get quotes around the variable name!
@jasonyeung2498
@jasonyeung2498 2 жыл бұрын
Might I ask if there was any package that could recursively do what you did in dbt to unwrap nested JSON and / or array? Thanks!
@KahanDataSolutions
@KahanDataSolutions 2 жыл бұрын
Hey Jason - There very well could be but I'm not familiar off the top of my head. Seems like a common scenario so I wouldn't be surprised if it exists somewhere.
@jasonyeung2498
@jasonyeung2498 2 жыл бұрын
@@KahanDataSolutions Thanks for the kind response. Might I ask, for example, let's say birth_name is another JSON. And, I simply want to reuse the marco again. intermediate_model as ( {{ flatten_json( model_name = 'source_model', json_column = 'birth_name' )}} ), how can I do it here by passing the source_model into the macro again?
@kirillmelnikov1700
@kirillmelnikov1700 9 ай бұрын
Hi 👋 How can I write if statement on dbt macros which will be go out loop, for example “if table exists - continue, else: break” ? Thx to advanced 🙏
@vlogwithkaran9078
@vlogwithkaran9078 Жыл бұрын
how do we perform lateral flatten in redshift?
@linaelyakhloufi4677
@linaelyakhloufi4677 2 жыл бұрын
Hello, Is it the same if our data is in amazon redshift please?
@henniedenooijer4348
@henniedenooijer4348 10 ай бұрын
Great vid!
@ihafidh
@ihafidh 2 жыл бұрын
Great video as always!
@KahanDataSolutions
@KahanDataSolutions 2 жыл бұрын
Thank you!
@kanthipavuluri3874
@kanthipavuluri3874 2 жыл бұрын
Nice video! Can you also share how we can determine the data types of the json fields, in this video everything is considered to be a varchar
@KahanDataSolutions
@KahanDataSolutions 2 жыл бұрын
Thanks Kanthi! You can use the TYPEOF function in Snowflake to determine the data type - docs.snowflake.com/en/sql-reference/functions/typeof.html
@summer_xo
@summer_xo 2 жыл бұрын
I started off by asking myself, "this is cool but how could I convince my team to use this vs flattening via ADF". By the end seeing how reusable it was totally sold me, so much quicker than spinning up a new ADF pipeline, creating source etc (assuming the extract isn't taking place in ADF). Im curious if you think there are any more benefits using DBT/Snowflake to flatten vs ADF?
@wallyflops
@wallyflops Жыл бұрын
That lateral keyword is really weird, the documentation doesn't mention it's use anywhere. Only when listing multiple it seems.
@domfp133
@domfp133 2 ай бұрын
TOP
@yslx740
@yslx740 2 жыл бұрын
Could you talk about getting proper data types, rather than just using varchar for everything? Would be super useful!
@KahanDataSolutions
@KahanDataSolutions 2 жыл бұрын
That is a bit more complex but it is doable. Here is an example function in Snowflake that you can use with JSON data to get you there - docs.snowflake.com/en/sql-reference/functions/typeof.html
@yslx740
@yslx740 2 жыл бұрын
@@KahanDataSolutions thanks, didn’t know about typeof
@abdullahsiddique7787
@abdullahsiddique7787 2 жыл бұрын
How long does it take to learn dbt for person knowing sql
@KahanDataSolutions
@KahanDataSolutions 2 жыл бұрын
That really depends on the individual. Like anything else, the advanced components will take time/experience to fully learn. But if you know SQL you should be able to start contributing to dbt projects pretty quickly once you learn the basic concepts.
@abdullahsiddique7787
@abdullahsiddique7787 2 жыл бұрын
@@KahanDataSolutions thanks bro yes I am good in sql
@lengoc5889
@lengoc5889 Жыл бұрын
OMG my problem in Bigquery. tks
How to use ONE dbt project for all environments
7:23
Kahan Data Solutions
Рет қаралды 21 М.
Airflow with DBT tutorial - The best way!
17:54
Data with Marc
Рет қаралды 48 М.
CAN YOU DO THIS ?
00:23
STORROR
Рет қаралды 48 МЛН
小丑揭穿坏人的阴谋 #小丑 #天使 #shorts
00:35
好人小丑
Рет қаралды 42 МЛН
бабл ти гель для душа // Eva mash
01:00
EVA mash
Рет қаралды 7 МЛН
Random Emoji Beatbox Challenge #beatbox #tiktok
00:47
BeatboxJCOP
Рет қаралды 55 МЛН
How to implement unit testing in dbt | Automated test framework in dbt
26:29
Mastering Snowflake
Рет қаралды 12 М.
How to use dbt Operators to run dynamic commands
7:45
Kahan Data Solutions
Рет қаралды 4,1 М.
How to use Exposures in dbt
6:46
Kahan Data Solutions
Рет қаралды 5 М.
Redis Deep Dive w/ a Ex-Meta Senior Manager
31:00
Hello Interview - SWE Interview Preparation
Рет қаралды 50 М.
How Notion Cut Latency by 20%
19:00
NeetCodeIO
Рет қаралды 76 М.
dbt and Python-Better Together
34:19
Databricks
Рет қаралды 12 М.
The Only Database Abstraction You Need | Prime Reacts
21:42
ThePrimeTime
Рет қаралды 219 М.
Use hooks to simplify repetitive dbt run activities
7:06
Kahan Data Solutions
Рет қаралды 26 М.
CAN YOU DO THIS ?
00:23
STORROR
Рет қаралды 48 МЛН