Forum Discussion
Using MLV to write data from a lakehouse into a warehouse
- 6 months ago
I stand corrected, you can use a shortcut, but you dont have to, you can query the MLV directly and insert it in a staging table in the warehouse, and from there ETL to your gold layer, using a pipeline
Some sample code:TRUNCATE TABLE stg.factSales_stg;INSERT INTO stg.factSales_stg(sale_id, sale_date, customer_id, product_id,quantity, amount, region_name, last_update_ts)SELECTsale_id, sale_date, customer_id, product_id,quantity, amount, region_name, SYSUTCDATETIME()FROM lh_sales.sales.v_fact_sales_mlvMLV to staging table, staging table ETL to gold layer is the considered best practice.
I have not realy used them, but as far as I understood, you create the MLV in your lake house (using a notebook or UI), you can than use that MLV to create a shortcut in the warehouse, where you could that shortcut to use the MLV to do a merge into your gold table in warehouse
A code example:
- pmscorca6 months agoKudo Kingpin
Hi, do you say that the best pratice to put MLV data into a warehouse is to use shortcuts without implementing any ETLs, obtaining optimal performances?
- smeetsh6 months agoContinued Contributor
I stand corrected, you can use a shortcut, but you dont have to, you can query the MLV directly and insert it in a staging table in the warehouse, and from there ETL to your gold layer, using a pipeline
Some sample code:TRUNCATE TABLE stg.factSales_stg;INSERT INTO stg.factSales_stg(sale_id, sale_date, customer_id, product_id,quantity, amount, region_name, last_update_ts)SELECTsale_id, sale_date, customer_id, product_id,quantity, amount, region_name, SYSUTCDATETIME()FROM lh_sales.sales.v_fact_sales_mlvMLV to staging table, staging table ETL to gold layer is the considered best practice.