Seventeen years of January taxi files in Databricks: what changing columns and file order decide
Read with the 2025 columns, 15 of 17 January taxi files were refused, while a map of each era's columns kept every row.
Every file, defect, query and layout behind the entry page, and four follow-ups.
The load: three ways to read 17 years
The newest-schema read takes the schema Spark reads from the 2025 file and reads every year with it, by column name. It loaded 2024 and 2025 (6,439,850 rows) and refused the rest. Thirteen files from 2011 to 2023 store zone and vendor ids as 64-bit integers, where 2025 uses 32-bit. The 2009 and 2010 files carry payment codes as text. Every refusal said "Data type mismatches when reading Parquet column ." with the column name left blank.
Reading the folder with schema merging switched on failed too, on the first pair of types it could not merge. Nothing loaded wrong without an error. The cost of the default is a stopped pipeline and an error that does not say where to look. Adding one file at a time with types converted did far better: see the third follow-up.
The schema-aware load maps each era's names and types to one schema: 2009 (its own names, text times, coordinates instead of zones), 2010 (other names, the same kinds), and 2011 on (one layout, names that differ only in case, types that drift). Every cast is a safe cast, so a value that cannot convert becomes empty. The checks count empty values after the cast and do not separate a failed cast from a value missing in the source. It kept all 153,598,220 rows, each with a pickup time.
| File (January) | Rows | Newest-schema read |
|---|---|---|
| 2009-01 | 14,092,413 | refused: text read as a number |
| 2010-01 | 14,863,778 | refused: text read as a number |
| 2011-01 | 13,464,997 | refused: 64-bit integer read as 32-bit |
| 2012-01 | 13,058,348 | refused: 64-bit integer read as 32-bit |
| 2013-01 | 14,776,617 | refused: 64-bit integer read as 32-bit |
| 2014-01 | 13,782,517 | refused: 64-bit integer read as 32-bit |
| 2015-01 | 12,741,035 | refused: 64-bit integer read as 32-bit |
| 2016-01 | 10,905,067 | refused: 64-bit integer read as 32-bit |
| 2017-01 | 9,710,820 | refused: 64-bit integer read as 32-bit |
| 2018-01 | 8,760,687 | refused: 64-bit integer read as 32-bit |
| 2019-01 | 7,696,617 | refused: 64-bit integer read as 32-bit |
| 2020-01 | 6,405,008 | refused: 64-bit integer read as 32-bit |
| 2021-01 | 1,369,769 | refused: 64-bit integer read as 32-bit |
| 2022-01 | 2,463,931 | refused: 64-bit integer read as 32-bit |
| 2023-01 | 3,066,766 | refused: 64-bit integer read as 32-bit |
| 2024-01 | 2,964,624 | loaded |
| 2025-01 | 3,475,226 | loaded |
Defects across the years
Flags, never deletions. 1,458,164 rows (0.95%) fail at least one of the five checks the trip fact table uses to mark a row valid. Two trends stand out. Trips with a distance of zero or less grew from 0.82% in 2009 to 2.62% in 2025. In 2025, 16.3% of trips have no or a zero passenger count and 1.81% a negative total. The 2009 file has 175,082 trips that end before they start, and no values at all for rate code and tax.
| File | Drop-off before pickup | Distance zero or less | Negative total | No or zero passengers | Unknown zone | Pickup outside the file's month |
|---|---|---|---|---|---|---|
| 2009-01 | 1.24% | 0.82% | 0.00% | 0.01% | 1.51% | 0.00% |
| 2010-01 | 0.00% | 0.56% | 0.00% | 0.00% | 1.80% | 0.00% |
| 2011-01 | 0.00% | 0.57% | 0.00% | 0.53% | 2.64% | 0.00% |
| 2012-01 | 0.00% | 0.48% | 0.00% | 2.11% | 2.50% | 0.00% |
| 2013-01 | 0.00% | 0.56% | 0.00% | 0.00% | 1.93% | 0.00% |
| 2014-01 | 0.01% | 0.56% | 0.00% | 0.00% | 1.43% | 0.00% |
| 2015-01 | 0.00% | 0.58% | 0.03% | 0.05% | 1.96% | 0.00% |
| 2016-01 | 0.00% | 0.58% | 0.04% | 0.00% | 1.62% | 0.00% |
| 2017-01 | 0.00% | 0.60% | 0.05% | 0.01% | 1.75% | 0.00% |
| 2018-01 | 0.00% | 0.63% | 0.05% | 0.68% | 1.81% | 0.00% |
| 2019-01 | 0.00% | 0.72% | 0.09% | 1.90% | 2.13% | 0.01% |
| 2020-01 | 0.00% | 1.10% | 0.30% | 2.81% | 0.74% | 0.00% |
| 2021-01 | 0.41% | 1.46% | 0.49% | 9.13% | 1.49% | 0.00% |
| 2022-01 | 0.05% | 1.19% | 0.52% | 5.01% | 1.21% | 0.00% |
| 2023-01 | 0.00% | 1.50% | 0.82% | 4.01% | 1.36% | 0.00% |
| 2024-01 | 0.00% | 2.04% | 1.20% | 5.79% | 0.41% | 0.00% |
| 2025-01 | 0.00% | 2.62% | 1.81% | 16.25% | 0.27% | 0.00% |
Layouts: four questions, three ways to store the trips
The same trip fact table, written three ways: no layout (22 files), partitioned by month (17 folders), and liquid clustered by pickup day and zone (35 files after optimising). Each question ran three times per layout, interleaved, in one session. The table shows medians. The follow-up's times below come from a second session, so compare times within a table, not across the two.
| Question and layout | MB read | Files read | Time against no layout |
|---|---|---|---|
| Airport pickups, one month: No layout | 13.1 | 1 of 22 | 1.00 |
| Airport pickups, one month: Partitioned by month | 5.7 | 1 of 17 | 0.85 |
| Airport pickups, one month: Clustered by day and zone | 15.2 | 2 of 35 | 1.04 |
| Revenue by zone, one day: No layout | 22.2 | 4 of 22 | 1.00 |
| Revenue by zone, one day: Partitioned by month | 22.8 | 6 of 17 | 1.03 |
| Revenue by zone, one day: Clustered by day and zone | 57.5 | 6 of 35 | 1.09 |
| One zone, 2011 to 2025: No layout | 237.5 | 18 of 22 | 1.00 |
| One zone, 2011 to 2025: Partitioned by month | 234.5 | 15 of 17 | 1.11 |
| One zone, 2011 to 2025: Clustered by day and zone | 42.1 | 6 of 35 | 0.81 |
| Tip share by year, no filter: No layout | 317.7 | 22 of 22 | 1.00 |
| Tip share by year, no filter: Partitioned by month | 315.3 | 17 of 17 | 0.89 |
| Tip share by year, no filter: Clustered by day and zone | 327.1 | 35 of 35 | 1.03 |
The table with no layout skipped 21 of 22 files on the one-month question because the table was written in one pass, by file in month order. Partitioning cut data read 2.3 times on that question, and run time barely moved. Only clustering helped the one-zone question.
Follow-up: the same rows in random order
If load order was doing the work, a table written in no particular order should lose it. A backfill that writes many months at once, or a merge of late data, moves a table that way. A full shuffle is the far end. So the same 153,598,220 rows were written in random order with no layout and ran the four questions again, three times each, interleaved with the plain and partitioned tables. The prediction, written before the run: at least 10 times the data on the one-month question and 5 times on the one-day question.
It read 35 times the data on the one-month question (452.7 MB against 13.1 MB) and 28 times on the one-day question. It read all 103 of its files every time. It also stored the same rows in 3.42 GB against 2.28 GB, because files of mixed months compress worse. Run time rose 1.6 times on the one-month question, far less than the data.
So the plain table's low reads came from how the pipeline wrote it: in month order, so each file holds one month or a few neighbouring ones. Random order spread every month across all 103 files. A team that keeps appends in time order gets most of what partitioning promises without it. A team that merges late data or backfills in parallel should measure files read after each run, and test a layout clustered on the column its common question filters by, here the source month.
| Question and layout | MB read | Files read | Time against no layout |
|---|---|---|---|
| Airport pickups, one month: No layout | 13.1 | 1 of 22 | 1.00 |
| Airport pickups, one month: Random order, no layout | 452.7 | 103 of 103 | 1.59 |
| Airport pickups, one month: Partitioned by month | 5.7 | 1 of 17 | 0.94 |
| Revenue by zone, one day: No layout | 22.2 | 4 of 22 | 1.00 |
| Revenue by zone, one day: Random order, no layout | 633.7 | 103 of 103 | 1.55 |
| Revenue by zone, one day: Partitioned by month | 22.8 | 6 of 17 | 1.06 |
| One zone, 2011 to 2025: No layout | 237.5 | 18 of 22 | 1.00 |
| One zone, 2011 to 2025: Random order, no layout | 405.7 | 103 of 103 | 1.29 |
| One zone, 2011 to 2025: Partitioned by month | 234.5 | 15 of 17 | 1.02 |
| Tip share by year, no filter: No layout | 317.7 | 22 of 22 | 1.00 |
| Tip share by year, no filter: Random order, no layout | 468.5 | 103 of 103 | 1.23 |
| Tip share by year, no filter: Partitioned by month | 315.3 | 17 of 17 | 0.94 |
Second follow-up: the one-month question for every month
Added after the results and declared before it ran. For every file of the three tables, the lowest and highest source month and pickup date it holds were recorded, which are the values the table format keeps per file for skipping. Then the one-month airport question ran once for each of the 17 months on each table, with a new value in the select list each time, and read files and bytes from the query history. None of the 51 runs came from the cache.
Kept in load order, each month sits in 1 or 2 of the 22 files. From 2011 to 2025 the question opened exactly those; in 2009 and 2010 it opened none, as below. Split by month it opened the 1 file holding the month in the same years. No layout ever opened a file outside the month. In 2009 and 2010 the ordered tables opened nothing: those years record pickup coordinates, not zone ids, so no row could match the zone filter, and no file was opened. In random order every month sits in all 103 files, and the question opened all 103 every time. The declared expectation was that the ordered tables would open exactly the files holding each month: it held from 2011 to 2025, not in 2009 and 2010, where they opened none. The declaration is kept with the study's source, outside this download. So the count that separates order from disorder is how many files hold the month, not whether the question opens more than those.
Over the 17 months, the split table read 234.7 MB in total against 296.0 MB in load order. From 2011 to 2019 it saved less than 1% in every month, because the load-order files each hold one month. The gain sits in 2020 to 2025, where smaller months share files. The random copy read 24.7 times the load-order total.
The pickup dates tell a different story. Stray dates such as 2001 and 2088 widen the date range of the later files, so up to 7 of the 22 load-order files have a date range that overlaps a given month. A question that filtered on pickup date could not skip those files. This one filters on the source month, whose ranges stay tight.
| Month | Files read of files holding the month, load order | Files read of files holding the month, by month | Files read of files holding the month, random | MB read, load order | MB read, by month | MB read, random |
|---|---|---|---|---|---|---|
| 2009-01 | 0 of 2 | 0 of 1 | 103 of 103 | 0.0 | 0.0 | 242.4 |
| 2010-01 | 0 of 2 | 0 of 1 | 103 of 103 | 0.0 | 0.0 | 271.7 |
| 2011-01 | 2 of 2 | 1 of 1 | 103 of 103 | 26.1 | 26.1 | 445.9 |
| 2012-01 | 2 of 2 | 1 of 1 | 103 of 103 | 25.0 | 24.9 | 452.7 |
| 2013-01 | 2 of 2 | 1 of 1 | 103 of 103 | 28.2 | 28.2 | 452.7 |
| 2014-01 | 2 of 2 | 1 of 1 | 103 of 103 | 25.0 | 25.0 | 452.7 |
| 2015-01 | 2 of 2 | 1 of 1 | 103 of 103 | 23.4 | 23.4 | 452.7 |
| 2016-01 | 2 of 2 | 1 of 1 | 103 of 103 | 20.2 | 20.2 | 452.7 |
| 2017-01 | 1 of 1 | 1 of 1 | 103 of 103 | 17.6 | 17.6 | 452.7 |
| 2018-01 | 1 of 1 | 1 of 1 | 103 of 103 | 16.7 | 16.7 | 452.7 |
| 2019-01 | 1 of 1 | 1 of 1 | 103 of 103 | 15.2 | 15.1 | 452.7 |
| 2020-01 | 1 of 1 | 1 of 1 | 103 of 103 | 15.0 | 12.0 | 452.7 |
| 2021-01 | 1 of 1 | 1 of 1 | 103 of 103 | 15.8 | 2.8 | 452.7 |
| 2022-01 | 2 of 2 | 1 of 1 | 103 of 103 | 27.8 | 4.6 | 452.7 |
| 2023-01 | 1 of 1 | 1 of 1 | 103 of 103 | 13.1 | 5.6 | 452.7 |
| 2024-01 | 1 of 1 | 1 of 1 | 103 of 103 | 12.9 | 5.6 | 452.7 |
| 2025-01 | 1 of 1 | 1 of 1 | 103 of 103 | 14.1 | 6.8 | 452.7 |
Third follow-up: simpler loads than the era map
Added after the results and declared before it ran. It asks whether the era map is needed at all, against the two simpler loads a data engineer would try first, on the same 17 raw files.
Added in turn, types converted. A table was created from the 2025 file with type widening switched on, a Delta setting that lets a column's type grow, such as a 32-bit integer to 64-bit. Each older file was then appended, newest first, as read from the file itself, with schema merging on. The ids of 2011 to 2023 were widened from 32-bit to 64-bit integers. The passenger counts and rate codes that 2019 to 2023 store as decimals were not widened but converted to the table's whole numbers, as the era map also does; follow-up 4 below shows that lost nothing. From 2011 to 2025 it matched the era map: the same rows, every one with a pickup time, and for every 2025 column at least as many values in every file. Names that differ only in case merged into one column. It refused 2009 and 2010: their payment codes are text, such as "CASH", and the table's payment column is a number. Their column names also differ from 2025's, as the load table shows, so they need a map either way. In all it kept 124,642,029 of the 153,598,220 rows.
Wide types, cast back. Every file was read with the 2025 names and every number column as a 64-bit decimal, then cast back. The reader refused all 17 files, 2025 included: it will not read a 64-bit integer column as a decimal. A second variant, declared after that result and before it ran, read integer columns as 64-bit integers and decimal columns as decimals. It loaded 10 files, 2011 to 2018, 2024 and 2025, every row with a pickup time, and the cast back lost no value. It refused 2019 to 2023, which store passenger count and rate code as decimals, and 2009 and 2010, which store payment codes as text.
The declared expectations held for the appended load and for the second wide variant. The first wide variant was expected to load 2011 to 2023 and loaded nothing. By the rule declared before the run, the call narrows: write a column map only for the years whose column names changed, and append the rest with types converted. The declarations are kept with the study's source, outside this download.
| File (January) | Era map | Added in turn, types converted | Every number as decimal | Widest kind per column |
|---|---|---|---|---|
| 2009-01 | 14,092,413 | refused: payment code is text | refused: 64-bit integer read as decimal | refused: text read as integer |
| 2010-01 | 14,863,778 | refused: payment code is text | refused: 64-bit integer read as decimal | refused: text read as integer |
| 2011-01 | 13,464,997 | 13,464,997 | refused: 64-bit integer read as decimal | 13,464,997 |
| 2012-01 | 13,058,348 | 13,058,348 | refused: 64-bit integer read as decimal | 13,058,348 |
| 2013-01 | 14,776,617 | 14,776,617 | refused: 64-bit integer read as decimal | 14,776,617 |
| 2014-01 | 13,782,517 | 13,782,517 | refused: 64-bit integer read as decimal | 13,782,517 |
| 2015-01 | 12,741,035 | 12,741,035 | refused: 64-bit integer read as decimal | 12,741,035 |
| 2016-01 | 10,905,067 | 10,905,067 | refused: 64-bit integer read as decimal | 10,905,067 |
| 2017-01 | 9,710,820 | 9,710,820 | refused: 64-bit integer read as decimal | 9,710,820 |
| 2018-01 | 8,760,687 | 8,760,687 | refused: 64-bit integer read as decimal | 8,760,687 |
| 2019-01 | 7,696,617 | 7,696,617 | refused: 64-bit integer read as decimal | refused: decimal read as integer |
| 2020-01 | 6,405,008 | 6,405,008 | refused: 64-bit integer read as decimal | refused: decimal read as integer |
| 2021-01 | 1,369,769 | 1,369,769 | refused: 64-bit integer read as decimal | refused: decimal read as integer |
| 2022-01 | 2,463,931 | 2,463,931 | refused: 64-bit integer read as decimal | refused: decimal read as integer |
| 2023-01 | 3,066,766 | 3,066,766 | refused: 64-bit integer read as decimal | refused: decimal read as integer |
| 2024-01 | 2,964,624 | 2,964,624 | refused: 64-bit integer read as decimal | 2,964,624 |
| 2025-01 | 3,475,226 | 3,475,226 | refused: 64-bit integer read as decimal | 3,475,226 |
| All 17 | 153,598,220 | 124,642,029 | 0 | 103,639,938 |
Follow-up 4: did the conversion cut anything? Added after the results and declared before it ran. Making the decimal counts whole could cut values, so one query over the five raw files of 2019 to 2023 counted the passenger counts and rate codes with a fractional part: none of the 41,332,760 values had one, as declared. So both the converted load and the era map kept every value.
Predictions, written before any run
- Reading all 17 years with the 2025 schema refuses at least 7 of the 15 files from 2009 to 2023 on a type error. Held: it refused all 15 of them.
- At least 14 million rows (the 2009 file) load with no error and no pickup time. The opposite held: no rows loaded silently; the 2009 file was refused on its text payment codes.
- Reading the folder with schema merging fails on incompatible types. Held: it failed to merge the schemas.
- The schema-aware load gives a pickup time to at least 99% of rows, against at most 82% for the newest-schema read. Held: 100% against 4.2%.
- Pickups outside the file's month stay under 0.1% in every file, and distance zero or less passes 0.5% in at least half the files. Held: at most 0.007%, and 16 of 17 files.
- Partitioning by month reads at most a fifth of the plain table's data on the one-month question, and clustering at most a fifth on the one-day question. Missed: 0.43 and 2.58 of the plain table's data. The opposite (the plain table within twice the best layout on both) held for one day only.
- The best layout is at most 3 times faster than the plain table on any question. Held: at most 1.23 times.
- Clustering reads less data than partitioning on the one-zone question. Held: 42.1 MB against 234.5 MB.
What the platform's guidance says
Databricks's page on partitioning says: "Most tables on Databricks with less than 100 TB of data don't need partitioning. Databricks uses Delta Lake for all tables by default and automatically clusters data in unpartitioned tables by ingestion time, so you get partitioning-like performance without manual tuning." This study agrees and adds two measurements: how much the ingestion order is worth on this table, and what a table written out of order costs.
Limits
- One month a year, one warehouse size, three runs per query. The main benchmark and the follow-up ran in two sessions. The second follow-up ran each month once per table, in a third session, and reports files and data read, not times.
- The random-order follow-up was chosen after the main results and declared before it ran. It is the worst case: the shuffle put every month in every file, so no file could be skipped. Its 35-fold figure applies only to these copies, whose file count, file sizes and compression all enter it. The copy had more files and compressed worse, and only one random order was tried, so the test does not separate order from file size.
- The cache was defeated with a value in the select list, not in the filter as designed: Databricks folds a constant filter away and the cache answered.
- Defect flags are rules of thumb on the published values; nothing was compared with the trips themselves.
- The documented steps were run once more from a fresh copy, with the data and results folders moved aside. Every count and prediction verdict came out the same, and so did the data read on every table but the clustered one. Clustering arranges rows differently on each run, so the rerun's clustered table read up to 9% more: 45.1 MB against 42.1 MB on the one-zone question.
- The simpler loads ran once each. Appending without type widening, and Auto Loader with its rescued-data column, which sets aside values it cannot read, were not tried.