Parquet marks a timestamp as an instant or a wall-clock value with one flag. Measured with pyarrow, pandas and DuckDB, including the day a report assigns.
Measured: what the writer stores and readers return
The local probe wrote one small Parquet file with pyarrow 26.0.1 and read it back with pyarrow, pandas 3.1.2 and DuckDB 2.0.1. It holds three synthetic Belgavi's Book Store orders placed in Kolkata at 23:45 on 30 November, 00:15 on 1 December and 09:30 on 1 December 2026. The same moments are written three ways: as a naive wall-clock value, as an instant with the Arrow zone UTC, and as an instant with the Arrow zone Asia/Kolkata.
| Column | Arrow type written | Parquet annotation | Read back by pyarrow | DuckDB type |
|---|---|---|---|---|
| placed_local | timestamp in microseconds, no zone | isAdjustedToUTC=false | no zone | TIMESTAMP |
| placed_utc | timestamp in microseconds, zone UTC | isAdjustedToUTC=true | zone UTC | TIMESTAMP WITH TIME ZONE |
| placed_kolkata | timestamp in microseconds, zone Asia/Kolkata | isAdjustedToUTC=true | zone Asia/Kolkata | TIMESTAMP WITH TIME ZONE |
The Parquet annotation for placed_utc and placed_kolkata is identical. Parquet itself has no place for a zone name. The name Asia/Kolkata came back in pyarrow and pandas because pyarrow also stores the Arrow schema in the file metadata, and readers that understand that metadata restore it. DuckDB, which reads the Parquet annotation, returned both as TIMESTAMP WITH TIME ZONE and displayed them in its session zone. pandas gave datetime64[us], datetime64[us, UTC] and datetime64[us, Asia/Kolkata] respectively.
Whose day is it
The question that breaks reports is which calendar day an order belongs to. The probe ran the same DuckDB query under three session zones and cast each column to DATE.
| Order placed in Kolkata | Date of placed_local in any session | Date of placed_utc, session UTC | Session Asia/Kolkata | Session America/New_York |
|---|---|---|---|---|
| 30 Nov 23:45 | 2026-11-30 | 2026-11-30 | 2026-11-30 | 2026-11-30 |
| 1 Dec 00:15 | 2026-12-01 | 2026-11-30 | 2026-12-01 | 2026-11-30 |
| 1 Dec 09:30 | 2026-12-01 | 2026-12-01 | 2026-12-01 | 2026-11-30 |
The wall-clock column gives the same date everywhere: the digits are the digits. The instant column gives a date that depends on the reader's session zone, which is correct behaviour for an instant and a surprise for anyone who expected the store's local day. A daily sales report built from placed_utc on a server running in UTC counts order 5102 in November; the same report run by Reviewer B in Kolkata counts it in December. Both are right about different questions.
The worst case comes from a common pipeline step. Many extract jobs convert instants to UTC and then drop the zone, because the target column type is a plain timestamp or because an older library did not support zones. The probe wrote the same three orders that way: UTC wall-clock digits, isAdjustedToUTC=false. Read in a Kolkata session, order 5102 shows 2026-11-30 18:45:00 and its date is 30 November. Nothing in the file says the digits are UTC; a reader has no way to know, and the local day is wrong by one for every order placed between midnight and 05:30 Kolkata time.
Choose the type by meaning
The rule is short: choose the timestamp type from what the value means, and make that choice visible in the schema.
- Events that happened at a moment, such as orders, payments and log records, are instants. Write them with a zone so the file carries
isAdjustedToUTC=true. - Values that are meant to be read as local clock time everywhere, such as opening hours and scheduled local events, are wall-clock values. Write them without a zone, and keep the zone they belong to in a separate column if anyone will ever need the instant.
- If a business day is defined in a particular zone, compute it explicitly in that zone and store it as its own
DATEcolumn, rather than leaving every reader to cast in their session zone.
import datetime as dt
import pyarrow as pa
import pyarrow.parquet as pq
def check_timestamp_columns(path: str, instants: set[str], wall_clock: set[str]) -> list[str]:
"""Fail when a column's Parquet annotation contradicts what it is documented to mean."""
schema = pq.ParquetFile(path).metadata.schema
problems = []
for i in range(len(schema)):
col = schema.column(i)
text = str(col.logical_type)
if not text.startswith("Timestamp("):
continue
adjusted = "isAdjustedToUTC=true" in text
if col.name in instants and not adjusted:
problems.append(f"{col.name}: documented as an instant but written without UTC adjustment")
if col.name in wall_clock and adjusted:
problems.append(f"{col.name}: documented as wall-clock but written as an instant")
return problems
def business_day(instant: dt.datetime, zone: dt.tzinfo) -> dt.date:
"""The store's calendar day for an instant, computed in the store's zone."""
return instant.astimezone(zone).date()Run a check like this in the pipeline that produces the file, against a short list of columns and their intended meaning. It costs one metadata read and catches a writer change before readers see it.
Migration steps for an existing lake
- List every timestamp column in the tables that matter and read its annotation from the Parquet footers, not from the catalog. Catalogs and engines often normalise types on read.
- For each column, write down what it means, an instant or a wall-clock value, and, for instants stored without adjustment, which zone the digits are in. Usually this needs the people who own the source system.
- Fix writers first. New files should carry the right annotation from the next run onward.
- For historical files with UTC digits and no adjustment, either rewrite them with the right type or add a view that reinterprets the column explicitly in the known zone, and point readers at the view.
- Add a business day column computed in the business zone for any table that feeds daily reports.
- Set the session zone explicitly in scheduled jobs that cast instants to dates. A job that depends on the server's zone gives a different answer after a move to another region.
Failure modes
- Mixed files in one table. A table whose older files are naive and newer files are adjusted reads inconsistently, and some engines refuse to union the two types. Check the footers of a sample across time, not just the newest file.
- Zone names lost in transit. Readers that ignore Arrow metadata see only UTC. If the original zone matters for display, store it as a column.
- Engines that pick a different default. Some engines read a naive Parquet timestamp as if it were UTC, others as local time, and some have options that change this. Test each engine your readers use against the same small file.
- Precision changes. Older writers used INT96 for timestamps with nanosecond precision. INT96 has no
isAdjustedToUTCflag at all, and engines interpret it by convention. Rewriting those files is the only fully reliable fix. - Daylight saving. Wall-clock values in zones with daylight saving have hours that occur twice or not at all. Converting them to instants needs a rule for those hours.
When this does not matter
If every writer and reader runs in UTC, every column is an instant, and every report defines days in UTC, the distinction never shows. Many internal analytics systems are like this. The question arises as soon as one reader works in another zone, a report needs a local business day, or a column that is really wall-clock time enters the lake.
How to verify it
The companion example parquet_timestamp_utc writes the file above with pinned versions of pyarrow, pandas and DuckDB, asserts the annotation of each column, runs the date query under the three session zones and asserts every cell in the table, and checks that the naive-UTC file reproduces the wrong day for order 5102. Copy the annotation check into your own writer tests.