Commit 208aa00
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 ec91776 commit 208aa00
2 files changed
+35
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
462 | 463 | | |
463 | 464 | | |
464 | 465 | | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
465 | 490 | | |
| 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 | | |
| |||
0 commit comments