-
Notifications
You must be signed in to change notification settings - Fork 16
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
Case Sensitivity in Schemas #32
Comments
Before taking dbt to our stack, we used case insensitive modes so our developers are not used to having to remember the capitalisations of schemas. It might be that this is an issue we should deal with locally but putting this out here in case others are finding the behaviour undesirable as well. |
The fix I made for the pull request is quite crude and suggestions of improvement are very welcome. |
Hi @JoelJuntunen , thanks for submitting the issue. One of the early adopters of You are right, the current convention is to use exactly the same casing in dbt models as was used in original Now, why don't we lower-case all database names in the the
BTW, it's not enough to add So the question is, is the community in favor of changing |
Maybe it's my lack of understand ANSI, but does it only apply to the column/schema names and not values of data? E.g., if we use where ColumnName like ('austin',adamtwo','Joel') and the data has it as ColumnName = AUSTIN ADAMTWO JOEL; will that work in Ansi mode? Everyone at my company is very used to non-ANSI and getting analytics power users to use DBT with ANSI has proven to create a lot of problems. I'm seeing string functions popup everywhere in our code. |
Teradata transaction mode (TERA) support added in dbt-teradata v1.7.1 |
Teradata ANSI mode which the adapter uses is case sensitive. This causes compilation errors if the schemas are defined in BTET mode and have different capitalisations since the adapter uses "where" conditions and won't find unambiguous results.
Steps To Reproduce:
Code:
CREATE MULTISET TABLE Schema_Name.IDENTIFIER_NAME ,FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
CHECKSUM = DEFAULT,
DEFAULT MERGEBLOCKRATIO,
MAP = TD_MAP1
(
field_name CHAR(1) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL
)
PRIMARY INDEX ( field_name );
{{
config(
materialized = 'table'
)
}}
with src as (
select *
from schema_name.identifier_name
)
dbt run -s {name of model}
Expected behavior
A clear and concise description of what you expected to happen.
Run clears without errors and the schemas are identified in a case insensitive way.
Screenshots and log output
If applicable, add screenshots or log output to help explain your problem.
The output of
dbt --version
:The operating system you're using:
Windows 10
The output of
python --version
:Python 3.9.9
Possible considerations:
Should the adapter support databases where there might be schemas with only differences being the capitalisation? If yes, this issue should be ignored and a workaround documented.
The text was updated successfully, but these errors were encountered: