Skip to content
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

Move reflections to rest API calls #256

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bcmeireles
Copy link
Contributor

Summary

Reflections were being created through the SQL Runner and that was the cause for some issues we were facing.

Description

The current reflections implementation requires sys.reflections access, which is only available to superusers (admins). When creating the reflection with a regular user, it will error. To fix this issue, the creation of the reflections has been moved from queries being ran inside the SQL Runner to Dremio's Rest API calls.
The current logic of writing reflections through a custom materialization remains to make sure reflections created under the previous approach still work.

On top of this, the behaviour where all reflections would be dropped and then recreated when running a dbt project has been changed to instead first check if a reflection with the same name is already present in the same dataset and, if that's the case, it will update the already existing reflection instead.

Test Results

wip

Changelog

  • Reflections are now handled through the Rest API, allowing non-admin users to also create them
  • It is now possible to set a custom name for reflections
  • If a reflection already exists in the dataset with the same name defined in the model, it will be updated instead of creating a new one
  • New date_dimensions parameter was added to the reflection materialization, to set fields that have a DATE granularity

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

Successfully merging this pull request may close these issues.

1 participant