Skip to content

Commit

Permalink
Replace create table statement in dremio__rename_relation() with get_…
Browse files Browse the repository at this point in the history
…create_table_as_sql macro.

Replacing drop table statement with the drop_relation macro leads to test_incremental_grants failing.
  • Loading branch information
ArgusLi committed Jan 27, 2023
1 parent fbc0446 commit 6d28e4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dbt/include/dremio/macros/adapters/relation.sql
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ limitations under the License.*/

{% macro dremio__rename_relation(from_relation, to_relation) -%}
{% call statement('rename_relation1/2 - create to_relation from from_relation') -%}
CREATE TABLE {{ to_relation }} AS (select * from {{from_relation}})
{{ get_create_table_as_sql(temporary=False, relation=to_relation, sql="select * from " ~ from_relation)}}
{%- endcall %}
{% call statement('rename_relation2/2 - drop from_relation') -%}
DROP TABLE {{ from_relation }}
DROP TABLE {{from_relation}}
{%- endcall %}
{% endmacro %}

0 comments on commit 6d28e4d

Please sign in to comment.