Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add interface to define a Row based serializer (#492)
Summary: Pull Request resolved: #492 # Background: Currently in order to successfully use UDP, you must write some carefully crafted code that will take all the rows of metadata for one side and package it into a collection of bytes. Afterwards the caller will get a `SecString` object back which is a bit representation of all the bytes they passed in, minus the filtered out rows. The user must then extract the corresponding bits for each column into separate MPC Types. This is a cumbersome process which is error prone, as you must make sure to carefully match up the two steps and any changes can cause a bug. # This Diff This diff defines the interface that the caller will use to pass in all their data for serialization / deserialization after UDP. Step 1. Put all the data into an unordered map of column name to type. Note that the variant type of the data must match the expected type based on the column (i.e. a uint32 column expects `std::vector<uint32_t>`, a int64 vec column expects `std::vector<std::vector<int64_t>>`. Call `serializeDataAsBytesForUDP` to get a vector of vector bytes ready for UDP consumption. Step 2. Pass this data into the UDP protocol data processor portion. Get back a `SecString` with all the filtered out rows and same structure Step 3. Call `deserializeUDPOutputIntoMPCTypes`. This will return the same unordered map of column names to the private MPC values that were deserialized from the SecString. The caller is in charge of unboxing the variants to the expected types. Reviewed By: haochenuw Differential Revision: D43366172 fbshipit-source-id: 93ac9751c77883e6ddddbecf950b36f7bf60c97d
- Loading branch information