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

Fix ORA-12098: cannot comment on the materialized view #147

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading