Skip to content
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Configuration variables
VERSION=1.7.1
VERSION=1.7.2
PROJ_DIR?=$(shell pwd)
VENV_DIR?=${PROJ_DIR}/.bldenv
BUILD_DIR=${PROJ_DIR}/build
Expand Down
2 changes: 1 addition & 1 deletion dbt/adapters/oracle/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
version = "1.7.4"
version = "1.7.7"
12 changes: 10 additions & 2 deletions dbt/include/oracle/macros/adapters.sql
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@
{%- if col['data_type'] is not defined -%}
{{ col_err.append(col['name']) }}
{%- endif -%}
{%- if col['data_type'] | lower == 'clob' -%}
empty_clob() as {{ col['name'] }}{{ ", " if not loop.last }}
{%- else -%}
cast(null as {{ col['data_type'] }}) as {{ col['name'] }}{{ ", " if not loop.last }}
{%- endif -%}
{%- endfor -%}
{# Override for Oracle #}
from dual
Expand Down Expand Up @@ -268,7 +272,7 @@
{% set comment = column_dict[column_name]['description'] %}
{% set escaped_comment = oracle_escape_comment(comment) %}
{% call statement('alter _column comment', fetch_result=False) -%}
comment on column {{ relation }}.{{ column_name }} is {{ escaped_comment }}
comment on column {{ relation }}.{{adapter.check_and_quote_identifier(column_name, model.columns)}} is {{ escaped_comment }}
{%- endcall %}
{% endfor %}
{% endif %}
Expand Down Expand Up @@ -362,7 +366,11 @@
else 'BASE TABLE'
end table_type
from sys.all_tables
where upper(table_name) not in (select upper(mview_name) from sys.all_mviews)
where upper(table_name) not in (
select upper(mview_name)
from sys.all_mviews
where upper(owner) = upper('{{ schema_relation.schema }}')
)
union all
select SYS_CONTEXT('userenv', 'DB_NAME'),
owner,
Expand Down
4 changes: 3 additions & 1 deletion dbt/include/oracle/macros/catalog.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
else 'BASE TABLE'
end table_type
from sys.all_tables
where upper(table_name) not in (select upper(mview_name) from sys.all_mviews)
where upper(table_name) not in (
select upper(mview_name)
from sys.all_mviews)
union all
select SYS_CONTEXT('userenv', 'DB_NAME'),
owner,
Expand Down
3 changes: 3 additions & 0 deletions dbt_adbs_test_project/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ quoting:
seeds:
dbt_adbs_test_project:
quote_columns: false
kafka_message:
+column_types:
message: CLOB
seed_with_empty_col:
+column_types:
id: number
Expand Down
1 change: 1 addition & 0 deletions dbt_adbs_test_project/models/kafka.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select * from {{ ref('kafka_message') }}
20 changes: 20 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,26 @@ sources:
- name: costs

models:
- name: kafka
description: kafka_description
config:
materialized: incremental
incremental_strategy: append
on_schema_change: fail
full_refresh: false
contract:
enforced: true
constraints:
- type: not_null
columns: [message]
columns:
- name: message
description: Kafka message
data_type: CLOB
constraints:
- type: not_null


- name: people
columns:
- name: id
Expand Down
6 changes: 6 additions & 0 deletions dbt_adbs_test_project/package-lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
packages:
- package: dbt-labs/dbt_utils
version: 0.8.6
- package: Snowflake-Labs/dbt_constraints
version: 0.4.2
sha1_hash: 7664cb2e33183f39e86a72079d63607e43a50ad8
5 changes: 5 additions & 0 deletions dbt_adbs_test_project/seeds/kafka_message.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
message
Jack-Hunter
Jack-Hunter
Jack-HunterJackHunter
Jack-Hunter
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dbt-core~=1.7,<1.8
cx_Oracle==8.3.0
oracledb==2.0.0
oracledb==2.0.1
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = dbt-oracle
version = 1.7.1
version = 1.7.2
description = dbt (data build tool) adapter for Oracle Autonomous Database
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down Expand Up @@ -34,7 +34,7 @@ include_package_data = True
install_requires =
dbt-core~=1.7,<1.8
cx_Oracle==8.3.0
oracledb==2.0.0
oracledb==2.0.1
test_suite=tests
test_requires =
dbt-tests-adapter~=1.7,<1.8
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
requirements = [
"dbt-core~=1.7,<1.8",
"cx_Oracle==8.3.0",
"oracledb==2.0.0"
"oracledb==2.0.1"
]

test_requirements = [
Expand All @@ -60,7 +60,7 @@

url = 'https://github.com/oracle/dbt-oracle'

VERSION = '1.7.1'
VERSION = '1.7.2'
setup(
author="Oracle",
python_requires='>=3.8',
Expand Down