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

[Bug] Renaming the old_relation does not work in Oracle 12c+ when using DBT table materialization with missing database name in profiles.yml #4

Closed
1 task done
ThoSap opened this issue May 4, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@ThoSap
Copy link
Contributor

ThoSap commented May 4, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

1 of 1 START table model staging.test.......................................................................... [RUN]
1 of 1 ERROR creating table model staging.test................................................................. [ERROR in 0.96s]
oracle adapter: Oracle error: ORA-00955: name is already used by an existing object

Finished running 1 table models in 0.96s.

Completed with 1 errors and 0 warnings:

Database Error in model test (models/generated/airbyte_tables/staging/test.sql)
  ORA-00955: name is already used by an existing object
  compiled SQL at ../build/run/airbyte_utils/models/generated/airbyte_tables/staging/test.sql

Done. PASS=0 WARN=0 ERROR=1 SKIP=0 TOTAL=1

Expected Behavior

1 of 1 OK created table model staging.test..................................................................... [OK in 1.45s]

Finished running 1 table models in 1.45s.

Completed successfully

Done. PASS=1 WARN=0 ERROR=0 SKIP=0 TOTAL=1

Steps To Reproduce

Run the DBT table materialization twice.

Relevant log output using --debug flag enabled

No response

Environment

- OS: Oracle Linux Server 8.5
- Python: 3.9.9
- dbt: 1.0.6

What Oracle database version are you using dbt with?

Tested using

  • Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
    and
  • Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Additional Context

Pull request fix #3

@ThoSap ThoSap added the bug Something isn't working label May 4, 2022
@ThoSap ThoSap changed the title [Bug] Dropping the old_relation does not work in Oracle 12c+ when using DBT table materialization [Bug] Renaming the old_relation does not work in Oracle 12c+ when using DBT table materialization May 4, 2022
@geoHeil
Copy link

geoHeil commented May 5, 2022

I can confirm to have the same problem

@ThoSap ThoSap changed the title [Bug] Renaming the old_relation does not work in Oracle 12c+ when using DBT table materialization [Bug] Renaming the old_relation does not work in Oracle 12c+ when using DBT table materialization with missing database name in profiles.yml May 5, 2022
@ThoSap
Copy link
Contributor Author

ThoSap commented May 5, 2022

@geoHeil what is your take on this #3 (comment)?
Please reply in the PR so we have everything in one place 😉

ThoSap pushed a commit to ThoSap/dbt-oracle that referenced this issue May 10, 2022
ThoSap pushed a commit to ThoSap/dbt-oracle that referenced this issue May 11, 2022
Signed-off-by: Thomas Sapelza <sapelza.thomas@gmail.com>

Signed-off-by: Thomas Sapelza <thomas.sapelza@gknpm.com>
aosingh added a commit that referenced this issue May 13, 2022
1. database param is optional. You can drop it from profiles.yml
2. Introduced a new macro get_database_name() which can be used if database param is missing
3. Overrides adapter methods - list_relations_without_caching(), get_relation()
4. Override catalog specific method - _get_one_catalog()
5. Modified snapshot macros to invoke get_database_name() if database param is missing
aosingh added a commit that referenced this issue May 13, 2022
1. Removed unnecessary imports from oracle/impl.py
2. Removed UPPER() from get_database_name() macro. This is not needed
aosingh added a commit that referenced this issue May 13, 2022
1. Updated sample_profiles.yml and profile_template.yml to remove database
aosingh added a commit that referenced this issue May 16, 2022
@aosingh aosingh self-assigned this May 18, 2022
@aosingh aosingh mentioned this issue May 20, 2022
@aosingh
Copy link
Member

aosingh commented May 24, 2022

This issue is fixed in release dbt-oracle==1.0.1
Closing

@aosingh aosingh closed this as completed May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants