Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
incremental support - strategy: append, insert_overwrite; onschema_c…
…hange: fail, ignore (#1) not supported strategy: merge, delete_overwrite; onschema_change: append_new_columns, sync_new_columns not supported: unique_key Ticket (internal JIRA): https://jira.cloudera.com/browse/DBT-38 https://jira.cloudera.com/browse/DBT-39 https://jira.cloudera.com/browse/DBT-48 https://jira.cloudera.com/browse/DBT-49 Testplan: 1. Basic dependencies need to be installed (dbt-core). 2. Build and install the dbt-impala adapter using: python3 setup.py install 3. Create a template dbt project using following: dbt init 4. Edit $HOME/.dbt/profiles.yml so that it looks similar to: demo_dbt: outputs: dev_impala: type: impala host: localhost port: 21050 dbname: s3test schema: s3test target: dev_impala 5. In the dbt project generated in step (2), run the following, which should succeed if local instance of Impala is up: dbt debug (check connection) 6. Create an incremental model with entry similar to, name it say, incremental_model.sql: {{ config( materialized='incremental', unique_key='id', incremental_strategy='insert_overwrite', ) }} select * from {{ ref('seed_sample') }} {% if is_incremental() %} where updated_at > (select max(updated_at) from {{ this }}) {% endif %} 7. Run this model using: dbt run [--full-refresh] --select incremental_model This should produce output similar to: 18:01:35 1 of 1 OK created incremental model s3test.my_third_dbt_model................... [OK in 63.16s] 18:01:35 18:01:35 Finished running 1 incremental model in 63.24s. 18:01:35 18:01:35 Completed successfully 18:01:35 18:01:35 Done. PASS=1 WARN=0 ERROR=0 SKIP=0 TOTAL=1 Co-authored-by: V. Ganesh <[email protected]>
- Loading branch information