Skip to content

Fix Cap’n Proto maps with scalar and enum values - #748

Merged
liuzicheng1987 merged 1 commit into
munich-data-engineering:mainfrom
lixin-wei:fix/capnproto-scalar-map-values
Oct 19, 2026
Merged

liuzicheng1987 merged 1 commit into
munich-data-engineering:mainfrom
lixin-wei:fix/capnproto-scalar-map-values

Conversation

@lixin-wei

Copy link
Copy Markdown
Contributor

Serializing a struct containing std::map<std::string, int> (or an unordered map with scalar values) fails during schema generation: Map(Int32) uses a scalar as a Cap’n Proto generic argument, which must be a pointer type. Enum-valued maps fail for the same reason, even when the map is empty.

Generate concrete map structs for scalar and enum values, with the value stored directly in each entry. Retain the existing generic Map(Value) schema for pointer-valued maps, so their generated schema and reader/writer paths stay unchanged.

Regression coverage checks empty and populated ordered/unordered maps, signed/unsigned 64-bit boundaries, booleans, floating-point values, enums, literals, and mixed/nested maps alongside string/list/optional values.

Validation: Release build with Clang and Cap’n Proto 1.1.0; all 59 Cap’n Proto CTest checks passed (58 runtime tests plus the compile regression).

@liuzicheng1987
liuzicheng1987 merged commit 6e8a406 into munich-data-engineering:main Oct 19, 2026
176 checks passed
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