Skip to content

Commit e5b503b

Browse files
Add: Query data with dlt normalized column names
Closes #224
1 parent 39fc872 commit e5b503b

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
id: '9950018686'
3+
question: How to query data when dlt normalizes column names to lowercase and snake_case?
4+
sort_order: 18
5+
---
6+
7+
DLT normalizes column names to lowercase and converts them to snake_case. For example, Trip_Pickup_DateTime becomes trip_pickup_date_time. When querying, use the normalized column names.
8+
9+
To discover the actual column names in a table, inspect the schema:
10+
11+
```sql
12+
SELECT column_name
13+
FROM information_schema.columns
14+
WHERE table_schema = 'taxi_data'
15+
```
16+
17+
Then use the normalized names in your queries, e.g.:
18+
19+
```sql
20+
SELECT trip_pickup_date_time
21+
FROM taxi_data.trips;
22+
```
23+
24+
Notes:
25+
- If you try to reference the original mixed-case column name (e.g., Trip_Pickup_DateTime) you may receive a "Referenced column not found" error because DLT has renamed the column.
26+
- Ensure you are querying the correct schema and table. The information_schema query above can help confirm the exact column names.
27+
28+
If you need to work with a column that has a non-normalized name, you can still enclose the column in double quotes, but with DLT's normalization you typically should use the lowercase snake_case name.

0 commit comments

Comments
 (0)