Type Coercion Gaps in Distributed SQL Engines: A Case Study of VARCHAR-to-INTERVAL Casting in Trino

Distributed SQL query engines expose large, federated type systems that grow incrementally over years. This makes it easy for individual coercions in the type lattice to go unimplemented long after the surrounding system has matured. This paper documents a concrete instance in Trino: the absence of CAST(VARCHAR AS INTERVAL DAY TO SECOND), a gap first reported by a Trino project founder in 2020 and left unresolved for six years despite the reverse operation (parsing INTERVAL literals) being present and battle-tested since the engine's earliest releases. We describe the gap, its practical impact on data pipelines that move interval values through text-based interchange formats, the design and implementation of a fix that reuses Trino's existing literal parser rather than introducing a parallel one, and a correctness lesson surfaced by continuous integration during that work. We distill three practical guidelines for engineers extending the type systems of mature distributed query engines. The implementation is available as a public pull request against the Trino project (github.com/trinodb/trino/pull/30737), addressing issue #4697.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-08-17
DOI
https://doi.org/10.5281/zenodo.21973272
Primary Topic
Advanced Database Systems and Queries
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
preprint

Type Coercion Gaps in Distributed SQL Engines: A Case Study of VARCHAR-to-INTERVAL Casting in Trino

Haseeb Mohammed Afsar
Zenodo (CERN European Organization for Nuclear Research)
Advanced Database Systems and Queries
preprint

Type Coercion Gaps in Distributed SQL Engines: A Case Study of VARCHAR-to-INTERVAL Casting in Trino

Haseeb Mohammed Afsar
preprint en

Abstract

Distributed SQL query engines expose large, federated type systems that grow incrementally over years. This makes it easy for individual coercions in the type lattice to go unimplemented long after the surrounding system has matured. This paper documents a concrete instance in Trino: the absence of CAST(VARCHAR AS INTERVAL DAY TO SECOND), a gap first reported by a Trino project founder in 2020 and left unresolved for six years despite the reverse operation (parsing INTERVAL literals) being present and battle-tested since the engine's earliest releases. We describe the gap, its practical impact on data pipelines that move interval values through text-based interchange formats, the design and implementation of a fix that reuses Trino's existing literal parser rather than introducing a parallel one, and a correctness lesson surfaced by continuous integration during that work. We distill three practical guidelines for engineers extending the type systems of mature distributed query engines. The implementation is available as a public pull request against the Trino project (github.com/trinodb/trino/pull/30737), addressing issue #4697.

Zenodo (CERN European Organization for Nuclear Research)
Industry, innovation and infrastructure
Advanced Database Systems and Queries
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Type Coercion Gaps in Distributed SQL Engines: A Case Study of VARCHAR-to-INTERVAL Casting in Trino — Haseeb Mohammed Afsar · Zenodo (CERN European Organization for Nuclear Research) (2026) | TGRS Research Map | TGRS