This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH source AS ( | |
SELECT | |
* | |
FROM | |
{{ source( | |
'product_management', | |
'product_history' | |
) }} | |
), | |
renamed AS ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# | |
- this macro creates incremental tables based | |
ON history DATA - it uses is_incremental() macro TO wrap valid SQL that filters THE rows - Filter will ONLY be applied | |
ON an incremental run - it uses unique_key PARAMETER which ensures THE existing ROW IS updated IN target TABLE #} | |
{%- macro generate_row_rank_using_event_ts_incremental(model, keycolumn) -%} | |
{%- set columns = adapter.get_columns_in_relation(model) -%} | |
{{ config(materialized = var('incremental'), unique_key = '__uuid') }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{%- macro generate_row_rank_using_event_ts(model, keycolumn) -%} | |
{%- set columns = adapter.get_columns_in_relation(model) -%} | |
WITH latest_data_changes AS | |
( | |
SELECT | |
ROW_NUMBER() OVER ( | |
PARTITION BY {{ keycolumn }} | |
ORDER BY __event_ts DESC | |
) AS row_rank, | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH product_info AS ( | |
SELECT | |
ROW_NUMBER() over ( | |
PARTITION BY product_id | |
ORDER BY | |
__event_ts DESC | |
) AS row_rank,* | |
FROM | |
{{ ref('src_product_management_product_history') }} | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wsl --install -d Ubuntu-20.04 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo rm /etc/resolv.conf | |
sudo bash -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf' | |
sudo bash -c 'echo "[network]" > /etc/wsl.conf' | |
sudo bash -c 'echo "generateResolvConf = false" >> /etc/wsl.conf' | |
sudo chattr +i /etc/resolv.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get upgrade |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wsl --set-default-version 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart |