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

Release/v1.0.3 #23

Merged
merged 17 commits into from
Jun 15, 2022
Merged

Release/v1.0.3 #23

merged 17 commits into from
Jun 15, 2022

Conversation

aosingh
Copy link
Member

@aosingh aosingh commented Jun 10, 2022

aosingh and others added 13 commits June 2, 2022 13:43
- Both Incremental materialization and Snapshots use temporary tables to stage new data. The data from the temp table is either merged or inserted into the target table. These temp tables are automatically truncated after the session exits, however they were never dropped.
- This fix first truncates the temporary table and then drops it.
changes are to address issues when using custom schemas

1 - create schema call verifies database. As of 1.0.7 Oracle adapter allows for database parm not to be set since Oracle doesn't allow statement prefix to include database name. Trickle down effect of that change is 'create schema check' not working hence why lines are removed. There is even dummy-noop already in that method since you can't create schemas dbt-way in oracle (schemas are users). 

2 - once #1 is addressed and custom schema is used, rename command will not find temp model table since schema is not passed as part of rename statement. Furthermore, rename statement will not work because Oracle doesn't support renaming tables that way. Alter Table to the rescue.

changed from 
rename <table_original_name> to <table_new_name>

to

alter table <schema>.<original_name> rename to <table_new_name>


tested with 
Python 3.9.1
dbt-core 1.0.7
dbt-oracle 1.0.2
1. Following macros changed or fixed in adapter.sql to use custom schema name - oracle__create_schema, oracle__create_view_as, oracle__alter_relation_comment, oracle__alter_column_type, oracle__drop_relation, oracle__truncate_relation, oracle__rename_relation, oracle__make_temp_relation

2. Changed view materialization strategy which unncessarily created an intermediate <model>__dbt_tmp view first and renamed it to the target view. Now we directly CREATE or REPLACE view <target_view_name>

3. Added generate_schema_name.sql as per dbt documentation in test project to determine the name of the schema that a model should be built in.

4. Changed a couple of models in the test project to use custom schema

5. Fixes Bug #14

6. Fixes Bug #2

7. Addresses issues raised in PR #15
…xisting relation then depending on the type we either drop or rename
…hema

Fix/manage objects in different schema
- Adapter method _make_match_kwargs() is updated to perform UPPER case comparison
- Adapter method quote_seed_column() is updated to not quote seed cols by default
- adapter.sql is updated to not lower case metadata
- catalog.sql is updated to not lower case metadata
- Incremental materialization needed a fix to perform a UPPER case comparison on the unique_key in ON clause
- Added a test scenarios in dbt_adbs_test_project to test integration with dbt_constraints
- Fixes Bug - #5
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jun 10, 2022
ThoSap and others added 3 commits June 10, 2022 20:51
Signed-off-by: Thomas Sapelza <sapelza.thomas@gmail.com>
Signed-off-by: Thomas Sapelza <sapelza.thomas@gmail.com>
@ramapemmaraju ramapemmaraju self-requested a review June 10, 2022 20:39
Copy link

@ramapemmaraju ramapemmaraju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me.

- Bumped version to v1.0.3
- Cleaned up README.md to consolidate docs to docs.getdbt.com side
@aosingh aosingh merged commit 4e5e528 into main Jun 15, 2022
@aosingh aosingh deleted the release/v1.0.3 branch June 16, 2022 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
4 participants