Skip to content

Commit de60ca3

Browse files
authored
fix(ingest): enable fuzzy case resolution for oracle sql (#12778)
1 parent 256e488 commit de60ca3

8 files changed

+275
-204
lines changed

metadata-ingestion/src/datahub/sql_parsing/sql_parsing_common.py

+7
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,19 @@
2424
# For SQL server, the default collation rules mean that all identifiers (schema, table, column names)
2525
# are case preserving but case insensitive.
2626
"mssql",
27+
# Oracle automatically converts unquoted identifiers to uppercase.
28+
# https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Database-Object-Names-and-Qualifiers.html#GUID-3C59E44A-5140-4BCA-B9E1-3039C8050C49
29+
# In our Oracle connector, we then normalize column names to lowercase. This behavior
30+
# actually comes from the underlying Oracle sqlalchemy dialect.
31+
# https://github.com/sqlalchemy/sqlalchemy/blob/d9b4d8ff3aae504402d324f3ebf0b8faff78f5dc/lib/sqlalchemy/dialects/oracle/base.py#L2579
32+
"oracle",
2733
}
2834
DIALECTS_WITH_DEFAULT_UPPERCASE_COLS = {
2935
# In some dialects, column identifiers are effectively case insensitive
3036
# because they are automatically converted to uppercase. Most other systems
3137
# automatically lowercase unquoted identifiers.
3238
"snowflake",
39+
"oracle",
3340
}
3441
assert DIALECTS_WITH_DEFAULT_UPPERCASE_COLS.issubset(
3542
DIALECTS_WITH_CASE_INSENSITIVE_COLS

0 commit comments

Comments
 (0)