Commit a768913
committed
fix: use writer types in Skipper for resolved named record types
When a writer-only field references a named Avro type that was previously
resolved against a reader schema, `parse_type` returns the registered
reader-resolved type from the shared resolver. This caused two problems:
1. The Skipper built its struct sub-skippers from the reader's field list,
which omits writer-only fields. Their bytes were never consumed, leaving
the cursor at the wrong position for all subsequent records.
2. Reader fields carry resolution-induced nullability (e.g. a writer plain
`long` matched against a reader `["null", long]` gains `nullability =
Some(NullFirst)`). The Skipper read a union-tag byte that was never
written, causing "Unexpected EOF" errors.
Fix: store the writer's data type in `ResolvedField::ToReader` alongside
the reader index. The Skipper's `Codec::Struct` arm now iterates
`rec.writer_fields` and uses the writer type from every entry - both
`ToReader(_, wdt)` and `Skip(wdt)` - so it always follows the writer's
wire format.1 parent 322f9ce commit a768913
2 files changed
+577
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
| |||
2341 | 2343 | | |
2342 | 2344 | | |
2343 | 2345 | | |
| 2346 | + | |
2344 | 2347 | | |
2345 | | - | |
| 2348 | + | |
2346 | 2349 | | |
2347 | | - | |
2348 | 2350 | | |
2349 | 2351 | | |
2350 | 2352 | | |
| |||
2888 | 2890 | | |
2889 | 2891 | | |
2890 | 2892 | | |
2891 | | - | |
| 2893 | + | |
2892 | 2894 | | |
2893 | 2895 | | |
2894 | 2896 | | |
| |||
2981 | 2983 | | |
2982 | 2984 | | |
2983 | 2985 | | |
2984 | | - | |
| 2986 | + | |
2985 | 2987 | | |
2986 | 2988 | | |
2987 | 2989 | | |
| |||
3802 | 3804 | | |
3803 | 3805 | | |
3804 | 3806 | | |
3805 | | - | |
| 3807 | + | |
3806 | 3808 | | |
3807 | | - | |
| 3809 | + | |
3808 | 3810 | | |
3809 | 3811 | | |
3810 | 3812 | | |
| |||
0 commit comments