Commit 46c84bf
committed
confluent,avro,salesforce: replace linkedin/goavro and hamba/avro with twmb/avro
Remove all linkedin/goavro and hamba/avro imports from the confluent,
avro, and salesforce packages. All Avro encoding and decoding now
uses github.com/twmb/avro.
Schema registry decoder uses EncodeJSON for JSON output paths and
Decode(TaggedUnions, TagLogicalTypes) with CustomType registrations
for the preserve_logical_types path. The avro_walker.go file contains
only connect-specific CustomType registrations: Kafka Connect type
translation (Debezium timestamps), Duration→Time for time-of-day
fields, and Duration→string for the duration logical type. All schema
tree walking, union wrapping, and branch naming are handled by
twmb/avro at decode time.
Avro processor and scanner use EncodeJSON(TaggedUnions, TagLogicalTypes)
for Avro JSON output and EncodeJSON() for standard JSON output.
Delete normalize_for_avro_schema.go (572 lines) — type coercion,
timestamp parsing, and union normalization are handled by twmb/avro's
Encode and DecodeJSON.
Subsumes PR #4124 (Fix avro timestamp encoding): twmb/avro's Encode
natively accepts RFC 3339 strings for timestamp fields.
File renames:
serde_goavro.go → serde_avro.go
serde_hamba_avro.go → avro_walker.go
useHamba → preserveLogicalTypes
Breaking change in preserve_logical_types mode:
Avro fixed fields in structured output (SetStructuredMut) are
now base64-encoded strings instead of arrays of integers. This
affects Bloblang expressions that access fixed field values as
arrays (e.g. this.fixedField.index(0)). The change only affects
users with preserve_logical_types enabled AND schemas containing
fixed-type fields — a rare combination. Fixed fields are binary
data and base64 is the standard JSON representation; the old
integer-array format was a hamba-specific behavior.
Error messages from twmb/avro differ in wording from goavro/hamba
but all invalid inputs are still rejected.1 parent c457f82 commit 46c84bf
18 files changed
Lines changed: 409 additions & 1806 deletions
File tree
- internal/impl
- avro
- confluent
- salesforce/salesforcegrpc
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | 116 | | |
118 | 117 | | |
119 | 118 | | |
| |||
167 | 166 | | |
168 | 167 | | |
169 | 168 | | |
| 169 | + | |
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| 279 | + | |
279 | 280 | | |
280 | 281 | | |
281 | 282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1727 | 1727 | | |
1728 | 1728 | | |
1729 | 1729 | | |
| 1730 | + | |
| 1731 | + | |
1730 | 1732 | | |
1731 | 1733 | | |
1732 | 1734 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
68 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
69 | 87 | | |
70 | 88 | | |
| 89 | + | |
| 90 | + | |
71 | 91 | | |
72 | 92 | | |
73 | 93 | | |
74 | 94 | | |
75 | 95 | | |
76 | | - | |
77 | | - | |
| 96 | + | |
| 97 | + | |
78 | 98 | | |
79 | 99 | | |
80 | 100 | | |
| |||
86 | 106 | | |
87 | 107 | | |
88 | 108 | | |
89 | | - | |
90 | | - | |
| 109 | + | |
| 110 | + | |
91 | 111 | | |
92 | 112 | | |
93 | | - | |
94 | | - | |
| 113 | + | |
95 | 114 | | |
96 | 115 | | |
97 | 116 | | |
98 | 117 | | |
99 | 118 | | |
100 | 119 | | |
101 | 120 | | |
102 | | - | |
103 | | - | |
| 121 | + | |
| 122 | + | |
104 | 123 | | |
105 | 124 | | |
106 | | - | |
107 | | - | |
| 125 | + | |
108 | 126 | | |
109 | 127 | | |
110 | 128 | | |
111 | 129 | | |
112 | 130 | | |
113 | | - | |
| 131 | + | |
114 | 132 | | |
115 | 133 | | |
| 134 | + | |
| 135 | + | |
116 | 136 | | |
117 | | - | |
| 137 | + | |
118 | 138 | | |
119 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
120 | 145 | | |
121 | | - | |
122 | | - | |
| 146 | + | |
| 147 | + | |
123 | 148 | | |
124 | 149 | | |
125 | 150 | | |
126 | 151 | | |
127 | 152 | | |
128 | 153 | | |
| 154 | + | |
| 155 | + | |
129 | 156 | | |
130 | | - | |
| 157 | + | |
131 | 158 | | |
132 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
133 | 164 | | |
134 | | - | |
135 | | - | |
| 165 | + | |
| 166 | + | |
136 | 167 | | |
137 | 168 | | |
138 | 169 | | |
139 | 170 | | |
140 | 171 | | |
141 | 172 | | |
| 173 | + | |
| 174 | + | |
142 | 175 | | |
143 | | - | |
| 176 | + | |
144 | 177 | | |
145 | | - | |
| 178 | + | |
146 | 179 | | |
147 | | - | |
148 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
149 | 186 | | |
150 | 187 | | |
151 | 188 | | |
| |||
155 | 192 | | |
156 | 193 | | |
157 | 194 | | |
158 | | - | |
| 195 | + | |
159 | 196 | | |
160 | 197 | | |
161 | | - | |
| 198 | + | |
162 | 199 | | |
163 | | - | |
| 200 | + | |
164 | 201 | | |
165 | 202 | | |
166 | 203 | | |
| |||
192 | 229 | | |
193 | 230 | | |
194 | 231 | | |
195 | | - | |
| 232 | + | |
196 | 233 | | |
197 | 234 | | |
198 | 235 | | |
199 | 236 | | |
200 | 237 | | |
201 | | - | |
| 238 | + | |
202 | 239 | | |
203 | 240 | | |
204 | 241 | | |
| |||
227 | 264 | | |
228 | 265 | | |
229 | 266 | | |
230 | | - | |
| 267 | + | |
231 | 268 | | |
232 | 269 | | |
233 | 270 | | |
234 | 271 | | |
235 | | - | |
| 272 | + | |
236 | 273 | | |
237 | 274 | | |
238 | 275 | | |
239 | 276 | | |
240 | 277 | | |
241 | 278 | | |
242 | 279 | | |
243 | | - | |
| 280 | + | |
244 | 281 | | |
245 | 282 | | |
246 | 283 | | |
| |||
249 | 286 | | |
250 | 287 | | |
251 | 288 | | |
252 | | - | |
| 289 | + | |
253 | 290 | | |
254 | 291 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | | - | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | | - | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
82 | | - | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
95 | 91 | | |
96 | 92 | | |
97 | 93 | | |
98 | | - | |
99 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
100 | 99 | | |
101 | 100 | | |
102 | 101 | | |
| |||
106 | 105 | | |
107 | 106 | | |
108 | 107 | | |
109 | | - | |
110 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
122 | 124 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | 125 | | |
129 | 126 | | |
130 | 127 | | |
131 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
132 | 135 | | |
133 | | - | |
| 136 | + | |
134 | 137 | | |
| 138 | + | |
135 | 139 | | |
136 | | - | |
137 | | - | |
| 140 | + | |
| 141 | + | |
138 | 142 | | |
139 | 143 | | |
140 | 144 | | |
141 | 145 | | |
142 | 146 | | |
143 | 147 | | |
144 | 148 | | |
145 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
146 | 152 | | |
0 commit comments