feat(io): complete binary + hex-WKB round-trip I/O for all types#112
Open
estebanzimanyi wants to merge 1 commit intomainfrom
Open
feat(io): complete binary + hex-WKB round-trip I/O for all types#112estebanzimanyi wants to merge 1 commit intomainfrom
estebanzimanyi wants to merge 1 commit intomainfrom
Conversation
Member
Author
Consolidation note — heavy overlap with
|
| File | This PR | main |
|---|---|---|
src/temporal/{set,span,spanset}{,_functions}.cpp + .hpp |
adds *FromBinary/*FromHexWKB for span/spanset, Set_from_binary |
c8cad6d feat(parity): Binary/HexWKB I/O for sets, spans, spansets adds the same surface PLUS Set_from_hexwkb, span/spanset asBinary/asHexWKB |
src/temporal/temporal.cpp |
adds tbool/tint/tfloat/ttext FromBinary | afac6eb adds those plus *FromHexWKB and *FromMFJSON for the same types |
src/geo/tgeometry_in_out.cpp |
adds tgeometryFromBinary |
91102ae adds that plus tgeometry/tgeographyFromEWKB/HexWKB/HexEWKB/MFJSON/Text/EWKT |
main's surface is a strict superset of this PR's surface. The unique value left in this PR is test/sql/wkb_roundtrip.test.
Suggested resolutions (maintainer's call — see docs/CONSOLIDATION-PLAN.md on #115)
- Close this PR, open a new test-only PR adding
test/sql/wkb_roundtrip.testrebased onmain. Cleanest history. - Force-rebase this PR onto
mainand dropb6056b7+bedba6a(their content is already inmain); keep onlya10ef79(now the timezone-neutral test). - Revert the parity commits on
main(afac6eb,91102ae,c8cad6d) and let this PR land instead. Loses the extrasmainhas on top.
Pre-emptive policy this aimed to prevent: see docs/PR-COORDINATION.md on #115.
I'm not going to unilaterally rewrite this PR's history; pinging here so the maintainer can pick.
3 tasks
Adds asBinary / xFromBinary and asHexWKB / xFromHexWKB for the types that were missing them, mirroring the roundtrip surface that tgeompoint and tgeogpoint already had: - Span (intspan / bigintspan / floatspan / datespan / tstzspan). - Spanset (intspanset / bigintspanset / floatspanset / datespanset / tstzspanset). - Set (intset / bigintset / floatset / textset / dateset / tstzset); asBinary already existed, fromBinary added. - Tgeometry: asBinary / tgeometryFromBinary via temporal_as_wkb / temporal_from_wkb (subtype-agnostic MEOS exports). The new wkb_roundtrip.test exercises every pair as a round-trip equality check against the original input — assertions are timezone-neutral (= comparisons or asText round-trips), so they hold regardless of the process timezone (CI uses TZ=UTC, developer machines may use anything).
a10ef79 to
fe60666
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
asBinary/xFromBinaryadded for span (5 types), spanset (5 types), set (6 types), tgeometry, and tbool/tint/tfloat/ttext — all previously missing.asHexWKB/xFromHexWKBadded for the same surfaces; set hadasHexWKBbut was missingxFromHexWKB.wkb_roundtrip.testcovers all 56 assertions (asBinary + asHexWKB round-trips for every type, including Parquet round-trip).&&(overlaps) between two tgeompoint values viaoverlaps_tspatial_tspatial.Motivation
Uniform binary serialization is required for Parquet round-trips (
COPY TO '*.parquet'). WithoutasBinary, types cannot be stored in BYTE_ARRAY Parquet columns and reloaded faithfully.asHexWKBis needed for text-based interchange (CSV, JSON, debug output).Test plan
test/sql/wkb_roundtrip.test— 56 assertions, all pass locally