Commit d155261
fix: Find VeloxType singletons for CustomType when embedded in OpaqueType objects (#15829)
Summary:
## Background
- This diff is to fix a bug in the Types::create() method for CustomType.
- The bug manifests in the SignatureBinder.bind() operation failing to match for a CustomType argument.
- The CustomType is basically an OpaqueType object.
- The root cause is that two different registries store OpaqueType objects.
- Custom Type Registry → VeloxType singleton (correct name())
- OpaqueSerdeRegistry → Base OpaqueType (name() = "OPAQUE")
- When deserializing the custom type in Type::create() method, the code does not find VeloxType singleton, hence created an OpaqueType.
- The CustomType returns its name in its custom name in the name() and toString() methods, whereas the OpaqueType returns "OPAQUE<demangled-name>" in its name/toString() methods.
## In this Diff
- The primary problem is that the CustomType has a Velox singleton for its type.
However, type is serialized and deserialized, the type produced is an Opaque type, with custom type inside.
- In this diff, the velox deserialization correctly finds and produces the VeloxType singleton.
## Implementation Changes
- Types.cpp
- Implemented searching and deserializing CustomType within OpaqueTypes in Type::create() method.
## Testing Changes
- OpaqueCustomTypesTest.cpp
- Added test to serialize/deserialize a CustomType and confirm that VeloxType singleton is returned.
Differential Revision: D895647691 parent b2125aa commit d155261
2 files changed
+24
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
207 | | - | |
| 206 | + | |
| 207 | + | |
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
223 | 228 | | |
224 | 229 | | |
225 | 230 | | |
| |||
237 | 242 | | |
238 | 243 | | |
239 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
240 | 248 | | |
241 | 249 | | |
242 | 250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
46 | 53 | | |
47 | 54 | | |
48 | 55 | | |
| |||
70 | 77 | | |
71 | 78 | | |
72 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
73 | 87 | | |
74 | 88 | | |
75 | 89 | | |
| |||
0 commit comments