-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rows_affected column for snowflake #208
Add rows_affected column for snowflake #208
Conversation
Thank you @iribarnesy ! |
Hi @iribarnesy, I have used the latest code for upload_model_executions.sql file, now rows_affected column value is reflecting but its always inserting 1. Sample Model used : select * from "SNOWFLAKE_SAMPLE_DATA"."TPCH_SF1"."CUSTOMER" where C_Nationkey=13 MODEL_EXECUTIONS table is getting populated with 1 as rows_affected column |
As I investigated before pushing that piece of code, I thought that the first run of any model will always return 1 for the number of rows_affected. I don't know if the source of this behavior is dbt-snowflake or snowflake. |
Could you try using dbt-snowflake==1.2.0? This behaviour should have been fixed as part of dbt-labs/dbt-snowflake#153. |
I am using 1.2.1 version and getting always 1 in row_affected column On model.my_new_project.test1: /* {"app": "dbt", "dbt_version": "1.2.1", "profile_name": "user", "target_name": "default", "node_id": "model.my_new_project.test1"} */ select * from "SNOWFLAKE_SAMPLE_DATA"."TPCH_SF1"."CUSTOMER" where C_Nationkey=13 |
You'll only see values greater other than 1 for incremental models which are running incrementally (not a full refresh), which it doesn't look like your example is. Snowflake only reports row counts for insert and merge into statements. Would you be able to try it with an incremental model and report back? |
Great, I changes the materialized='incremental'. Now its capturing the affected rows. Thanks you! |
Reference the issue #196
[x] model_executions
[x] seed_executions
[x] snapshot_executions