Incremental model fails when pushed to Prod for the first time

I’m facing an issue with our PSA and Raw Vault layers. We’ve added a new Satellite table that appends data from the PSA layer. However, when we push it to production, I encounter the following error:

Database Error in model link_rf_customer_account (models/raw_vault_rebuild/link/link_rf_customer_account.sql)
002003 (42S02): SQL compilation error: Object 'DATAVAULT_PROD.STAGING.PSA_STG_CUSTOMER_ACCOUNT' does not exist or you are not authorized.

Any help on resolving this would be appreciated!

It worked when i tried the following: dbt build -s +link_rf_customer_account --full-refresh

I would like to learn why did that happen and how to prevent this in future.

Hey @smishanth, have you added an is_incremental() block? On the first run, the table will not have been materialized before, hence the ‘object does not exist’ error & why only running it as a full-refresh works (this is a drop if exists + rebuild). However, for subsequent builds you’ll need your conditions to be inside the block, with all of the 4 criteria listed in the docs satisfied for the incremental strategy to work properly: Configure incremental models | dbt Developer Hub

Hey @DataNath Thanks for your reply. YEs i do have the incremental blocks defined.