Gora Bhattacharya
Gora Bhattacharya

Reputation: 21

Load data from a non partition table to partitioned table using DBT incremental model

I am trying to create a dbt model which will fetch data from a non partitioned table (Table A) and insert in a partitioned table (Table B). The data is in Bigquery. On daily basis , all data will be fetched from table A and will be inserted into a new partition in Table B.

{{
    config(
        materialized='incremental',
        partition_by = { 'field': 'load_dt', 'data_type': 'date' },
        incremental_strategy = 'insert_overwrite'
    )
}}


select * from {{ source('Own_Data', 'non_part_bike') }}

This one is working fine , but just trying to understand if there is a better approach or any other best practice for this.

Upvotes: 0

Views: 198

Answers (0)

Related Questions