Nessie-DBT Branching feature

Could you please suggest if we can create the table into other branch than “main” using DBT in nessie?
I wrote the below macro: {% macro test_branching() %}
{% set sql %} USE REFERENCE “test_branch” in NessieCatalog {% endset %}
{% do run_query(sql) %}

{% endmacro %}
My model: {{ test_branching() }}
SELECT product_id FROM NessieCatalog.Bronze.products WHERE product_id > 2
but it didn’t work. Could you please help me on this?

For the USE statement to take effect for subsequent SQL statements, they have to be executed in the same session. (Excludes Dremio UI).

You can also avoid the USE statement by directly specifying the AT syntax in the table reference like:

select * from foo AT BRANCH bar

Hi Benny,

I want to create the table in the “test-branch” while doing as per your suggestion, table is getting created in the main branch itself not in the test-branch.

Please let me know if I am missing something.

Hi, Could you please help me with the mentioned issue?

Sorry, I’m not familiar enough with dbt to help you debug this. Hopefully, someone else in the forums can chime in here.