Commit c3a718a
authored
[venice-common] Fix missing SchemaAdapter.adaptToSchema() in (linkedin#2640)
Fix schema adaptation in setElementsToRemoveFromListField
setElementsToRemoveFromListField in UpdateBuilderImpl does not call
SchemaAdapter.adaptToSchema() on elementsToRemove, unlike the symmetric
setElementsToAddToListField method which does. This causes Avro
serialization failures when input records have extra fields (e.g., from
an evolved schema) that do not match the Venice WriteOp schema.
The root cause exception is:
java.lang.ClassCastException: class java.lang.Long cannot be cast to class
java.util.List during serialization, because unadapted records with
mismatched schemas are placed into the setDiff field.
Add the missing SchemaAdapter.adaptToSchema() call in
setElementsToRemoveFromListField, making it consistent with
setElementsToAddToListField, setEntriesToAddToMapField, and
setNewFieldValue.1 parent 129c3a9 commit c3a718a
2 files changed
Lines changed: 24 additions & 1 deletion
File tree
- internal/venice-common/src
- main/java/com/linkedin/venice/writer/update
- test/java/com/linkedin/venice/writer/update
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
| |||
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
119 | 140 | | |
120 | 141 | | |
121 | 142 | | |
| |||
0 commit comments