Skip to content

pgduck: expose BuildIcebergReadConversion on release-3.5 - #734

Merged
sfc-gh-okalaci merged 1 commit into
release-3.5from
okalaci/release-3.5-export-iceberg-read-conversion
Oct 12, 2026
Merged

sfc-gh-okalaci merged 1 commit into
release-3.5from
okalaci/release-3.5-export-iceberg-read-conversion

Conversation

@sfc-gh-okalaci

@sfc-gh-okalaci sfc-gh-okalaci commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Cherry-pick pgduck: expose BuildIcebergReadConversion #680 onto release-3.5 so BuildIcebergReadConversion is declared and no longer static.
  • The function body and its in-repo callers are unchanged. This only exports what pg_lake main already exports.

Test plan

  • Confirm the declaration is in pg_lake_engine/include/pg_lake/pgduck/read_data.h and the definition in read_data.c is no longer static
  • pg_lake_engine builds on this branch

Made with Cursor

Iceberg stores an INTERVAL as a struct of months/days/microseconds and a
TIMETZ as a UTC-normalized TIME.  BuildIcebergReadConversion builds the
DuckDB expression that lifts those leaves back to the types PostgreSQL
expects, recursing through arrays, composites, maps and domains.  The read
path applies it to anything projected through TupleDescToProjectionList.

A caller that reads the CSV files directly, building its own query rather
than going through that projection, has no way to apply the conversion
itself.  Its input functions then get the storage form: interval_in receives
"(38,5,14706789000)", and a TIMETZ stripped to a bare TIME is reinterpreted
against the caller session's TimeZone, shifting the instant by that
session's offset without raising anything -- a silent wrong answer, and one
that is invisible on a UTC cluster.

Declare it in read_data.h so such a caller can build the same expression the
read path builds.  The body and both in-repo callers are unchanged, so this
adds visibility rather than code.

Signed-off-by: Amy Zheng <amy.zheng@snowflake.com>
(cherry picked from commit 74626e9)
@sfc-gh-okalaci
sfc-gh-okalaci merged commit bbbdbb3 into release-3.5 Oct 12, 2026
12 checks passed
@sfc-gh-okalaci
sfc-gh-okalaci deleted the okalaci/release-3.5-export-iceberg-read-conversion branch October 12, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants