Skip to content

Commit

Permalink
Fix ORA-12098: cannot comment on the materialized view
Browse files Browse the repository at this point in the history
  • Loading branch information
aosingh committed Jul 1, 2024
1 parent 2c107d4 commit 4268795
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions dbt/include/oracle/macros/adapters.sql
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,12 @@

{% macro oracle__alter_relation_comment(relation, comment) %}
{% set escaped_comment = oracle_escape_comment(comment) %}
{% if relation.type == 'materialized_view' %}
comment on materialized view {{ relation }} is {{ escaped_comment }}
{% else %}
{# "comment on table" even for views #}
comment on table {{ relation }} is {{ escaped_comment }}
{% endif %}
{% endmacro %}

{% macro oracle__persist_docs(relation, model, for_relation, for_columns) -%}
Expand Down
2 changes: 1 addition & 1 deletion dbt_adbs_test_project/models/sales_internet_mv.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
See the License for the specific language governing permissions and
limitations under the License.
#}
{{ config(materialized='materialized_view')}}
{{ config(materialized='materialized_view', persist_docs={"relation": true, "columns": true}) }}
select * from {{ source('sh_database', 'sales') }}
where channel_id = 5
3 changes: 3 additions & 0 deletions dbt_adbs_test_project/models/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ sources:
- name: costs

models:
- name: sales_internet_mv
description: Test comment for Materialized View

- name: kafka
description: kafka_description
config:
Expand Down

0 comments on commit 4268795

Please sign in to comment.