Files
floci/docs
Priamo Germosen 6fd20879d5 fix(athena): type Hive partition values as their keys declare (#8590)
Athena types a partition value as its key declares. Floci left the
values DuckDB's Hive partitioning reads from column=value folders to
DuckDB's autocast, so a string key holding 2026-11-14 came back as a
DATE, and a date key's folder holding text no date is read as rows with
the guessed type. Delimited-text tables already read their values as
text and cast them; every other format did not.

- A partitioned table without a location template reads with
  hive_types_autocast = false, so each Hive partition value arrives as
  text, and buildProjection casts it to its key's declared type
  (GlueTableResolver.hivePartitionKeys), as it already did for
  delimited text.
- A projecting table in the default layout keeps only rows whose typed
  keys parse as their types (hiveValueFilter): Athena builds each path
  from values its projection generates, so a folder like dt=latest for
  a date key is one no query addresses, as the template layout already
  treats it.
- A date or timestamp key whose date projection sets a format is parsed
  with it in either layout (typedKey, strptimeFormat translating yyyy,
  yy, MM, dd, HH, mm, ss and literal text, a doubled quote being one
  quote, for try_strptime), so dt=20261116
  under yyyyMMdd reads as a date; a format with other pattern letters is
  cast as an ISO value. This closes the template layout's TODO too.
- Iceberg tables keep reading their own typed values.

AthenaPartitionTemplateSidecarIntegrationTest reads a string key
holding a date as VARCHAR, a date key as DATE, and skips a dt=latest
folder, and a yyyyMMdd date projection, against the real engine.
GlueViewDdlBuilderTest and GlueTableResolverTest cover the view and the
pattern translation.
athena.md says so.
2026-11-16 11:08:45 -04:00
..
2026-03-15 17:43:56 -05:00