Skip to content

Commit 4bae91f

Browse files
Merge pull request #133 from oracle/backports-1.6
v1.6.3
2 parents 5e2b4e4 + 0c77bb9 commit 4bae91f

File tree

11 files changed

+43
-10
lines changed

11 files changed

+43
-10
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Configuration variables
2-
VERSION=1.6.2
2+
VERSION=1.6.3
33
PROJ_DIR?=$(shell pwd)
44
VENV_DIR?=${PROJ_DIR}/.bldenv
55
BUILD_DIR=${PROJ_DIR}/build

dbt/include/oracle/macros/adapters.sql

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@
4040
{%- if col['data_type'] is not defined -%}
4141
{{ col_err.append(col['name']) }}
4242
{%- endif -%}
43-
cast(null as {{ col['data_type'] }}) as {{ col['name'] }}{{ ", " if not loop.last }}
43+
{%- if col['data_type'] | lower == 'clob' -%}
44+
empty_clob() as {{ col['name'] }}{{ ", " if not loop.last }}
45+
{%- else -%}
46+
cast(null as {{ col['data_type'] }}) as {{ col['name'] }}{{ ", " if not loop.last }}
47+
{%- endif -%}
4448
{%- endfor -%}
4549
{# Override for Oracle #}
4650
from dual
@@ -268,7 +272,7 @@
268272
{% set comment = column_dict[column_name]['description'] %}
269273
{% set escaped_comment = oracle_escape_comment(comment) %}
270274
{% call statement('alter _column comment', fetch_result=False) -%}
271-
comment on column {{ relation }}.{{ column_name }} is {{ escaped_comment }}
275+
comment on column {{ relation }}.{{ adapter.check_and_quote_identifier(column_name, model.columns) }} is {{ escaped_comment }}
272276
{%- endcall %}
273277
{% endfor %}
274278
{% endif %}
@@ -384,7 +388,7 @@
384388
else 'BASE TABLE'
385389
end table_type
386390
from sys.all_tables
387-
where upper(table_name) not in (select upper(mview_name) from sys.all_mviews)
391+
where upper(table_name) not in (select upper(mview_name) from sys.all_mviews where upper(owner) = upper('{{ schema_relation.schema }}'))
388392
union all
389393
select SYS_CONTEXT('userenv', 'DB_NAME'),
390394
owner,

dbt/include/oracle/macros/materializations/incremental/incremental.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
{% materialization incremental, adapter='oracle', supported_languages=['sql', 'python'] %}
1818

1919
{% set unique_key = config.get('unique_key') %}
20-
{% set full_refresh_mode = flags.FULL_REFRESH %}
20+
{% set full_refresh_mode = should_full_refresh() %}
2121
{%- set language = model['language'] -%}
2222
{% set target_relation = this.incorporate(type='table') %}
2323
{% set existing_relation = load_relation(this) %}

dbt_adbs_test_project/dbt_project.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ quoting:
1818
seeds:
1919
dbt_adbs_test_project:
2020
quote_columns: false
21+
kafka_message:
22+
+column_types:
23+
message: CLOB
2124
seed_with_empty_col:
2225
+column_types:
2326
id: number
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
select * from {{ ref('kafka_message') }}

dbt_adbs_test_project/models/schema.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,25 @@ sources:
1818
- name: costs
1919

2020
models:
21+
- name: kafka
22+
description: kafka_description
23+
config:
24+
materialized: incremental
25+
incremental_strategy: append
26+
on_schema_change: fail
27+
full_refresh: false
28+
contract:
29+
enforced: true
30+
constraints:
31+
- type: not_null
32+
columns: [message]
33+
columns:
34+
- name: message
35+
description: Kafka message
36+
data_type: CLOB
37+
constraints:
38+
- type: not_null
39+
2140
- name: people
2241
columns:
2342
- name: id

dbt_adbs_test_project/models/us_product_sales_channel_ranking.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
config(
1818
materialized='incremental',
1919
unique_key='group_id',
20+
full_refresh=false,
2021
parallel=4,
2122
table_compression_clause='COLUMN STORE COMPRESS FOR QUERY LOW')
2223
}}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
message
2+
Jack-Hunter
3+
Jack-Hunter
4+
Jack-HunterJackHunter
5+
Jack-Hunter

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
dbt-core~=1.6,<1.7
22
cx_Oracle==8.3.0
3-
oracledb==1.4.2
3+
oracledb==2.0.1

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = dbt-oracle
3-
version = 1.6.2
3+
version = 1.6.3
44
description = dbt (data build tool) adapter for the Oracle database
55
long_description = file: README.md
66
long_description_content_type = text/markdown
@@ -34,7 +34,7 @@ include_package_data = True
3434
install_requires =
3535
dbt-core~=1.6,<1.7
3636
cx_Oracle==8.3.0
37-
oracledb==1.4.2
37+
oracledb==2.0.1
3838
test_suite=tests
3939
test_requires =
4040
dbt-tests-adapter~=1.6

0 commit comments

Comments
 (0)