pub fn align_json_array(
json_array: &ArrayRef,
schema_type: &DataType,
) -> Result<ArrayRef>Expand description
Align a json array json_array to the json type schema_type. The schema_type is often the
“largest” json type after some insertions in the table schema, while the json array previously
written in the SST could be lagged behind it. So it’s important to “amend” the json array’s
missing fields with null arrays, to align the array’s data type with the provided one.
§Panics
- The json array is not an Arrow [StructArray], or the provided data type
schema_typeis not of Struct type. Both of which shouldn’t happen unless we switch our implementation of how json array is physically stored.