docs/sql/identifiers.md
Daft's SQL identifiers are case-sensitive by default, but support a case-insensitive and a case-normalize mode. For both the case-insensitive and case-sensitive modes, identifiers are case-preserved and are matched based upon the mode. For the case-normalize mode, unquoted (regular) identifiers are normalized to lowercase and double-quoted (delimited) identifiers are case-preserved. You can configure these modes via the SessionOptions when creating a session. These modes apply when resolving attached catalogs, attached tables, and columns via the session.
!!! warning "Warning"
Catalogs such as Iceberg and Unity have incompatible resolution rules which means we cannot guarantee consistency across catalog implementations.
It is currently not feasible to ensure consistent casing semantics across catalogs, so we recommend using the different modes to find which best
fits your preferences and current systems. When working across multiple systems, using all lowercase names for namespace and tables with identifier_mode = 'normalize' provides the most consistent experience.
-- regular identifier
abc
-- delimited identifier
"abc"
-- qualified identifier
abc.xyz
-- qualified identifier with mixed parts
a."b".c
-- delimited identifier with special characters
SELECT "🍺" FROM "🍻"
Rules
'_' character.'$' and '_' characters.!!! tip ""
We recommend trying these settings to determine which works best for your workloads.
| Mode | Behavior | Compatibility |
|---|---|---|
insensitive | All identifiers are matched case-insensitively and names are case-preserved. | duckdb, spark, unity |
sensitive | All identifiers are matched case-sensitively and names are case-preserved. | python, iceberg |
normalize | Unquoted (regular) identifiers and names are case-normalized to lowercase. | trino, postgres, datafusion |
The identifier mode is configured at the session level. Currently, Daft uses case-sensitive mode by default.
!!! note "Future Configuration"
Python APIs for configuring the identifier mode are planned for a future release. For now, the default case-sensitive mode is used.