Skip to content

#479: on_table_exists=skip option for table materialization#481

Merged
damian3031 merged 1 commit intostarburstdata:masterfrom
nielsen-oss:issue/479
Jun 3, 2025
Merged

#479: on_table_exists=skip option for table materialization#481
damian3031 merged 1 commit intostarburstdata:masterfrom
nielsen-oss:issue/479

Conversation

@choyrim
Copy link
Copy Markdown
Contributor

@choyrim choyrim commented May 6, 2025

implements on_table_exists=skip option

instead of creating the table, it simply executes "select 1"

resolves #479

As requested by @damian3031 in his feedback, a revised checklist:

  • Rebase onto master, as CI failures have been fixed there.
  • Remove .changes/1.10.0.md file and revert changes to CHANGELOG.md.
  • move feature test case to bottom of relevant file.
  • additional assertions in tests
  • simplify adapter CTAS logic
  • add a changie file by running changie new.
  • Squash commits into a single one.
  • Install and run pre-commit checks before committing your changes.

@choyrim choyrim changed the title Issue/479 #479: on_table_exists=skip option for table materialization May 6, 2025
@choyrim
Copy link
Copy Markdown
Contributor Author

choyrim commented May 7, 2025

added a change to use "CREATE TABLE IF NOT EXISTS" to do the skipping instead of "SELECT 1"

this makes it so that the generated SQL is more useful.

Copy link
Copy Markdown
Member

@damian3031 damian3031 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution! Some remarks:

  1. Remove .changes/1.10.0.md file and revert changes to CHANGELOG.md. Instead, add a changie file by running changie new.
  2. Squash commits into a single one.
  3. Rebase onto master, as CI failures have been fixed there.
  4. Install and run pre-commit checks before committing your changes.

@choyrim choyrim marked this pull request as draft June 2, 2025 22:08
implement table materialization option on_table_exists=skip to allow
user to skip a model if the target relation already exists.
@choyrim choyrim marked this pull request as ready for review June 3, 2025 01:36
@choyrim
Copy link
Copy Markdown
Contributor Author

choyrim commented Jun 3, 2025

@damian3031 thank you for your feedback. i believe i have resolved the issues you raised.

i've run tox -r and pre-commit run --all-files and the tools seem happy.

i am also happy to add documentation. but it wasn't clear to me where to add the documentation.

Copy link
Copy Markdown
Member

@damian3031 damian3031 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@choyrim Thanks for your work!

Regarding documentation, it is hosted by dbt, you need to create PR to make change here.

Please add skip strategy after replace and tag me in a PR.

@damian3031 damian3031 merged commit 04ccc44 into starburstdata:master Jun 3, 2025
12 checks passed
@choyrim
Copy link
Copy Markdown
Contributor Author

choyrim commented Jun 10, 2025

@choyrim Thanks for your work!

Regarding documentation, it is hosted by dbt, you need to create PR to make change here.

Please add skip strategy after replace and tag me in a PR.

@damian3031

sorry for the delay. I need to do some administrative formalities before I can contribute to the doc project. I will take care of those formalities soon and tag you in a PR in two weeks or so.

@choyrim
Copy link
Copy Markdown
Contributor Author

choyrim commented Jun 15, 2025

@damian3031 tagged you in the docs.getdbt.com PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

table materialization on_table_exists=skip option

2 participants