From ca2d2a61524d949cfdd05935409c1ab9b22311af Mon Sep 17 00:00:00 2001 From: Christian Beilschmidt Date: Thu, 12 Sep 2024 11:51:31 +0200 Subject: [PATCH] serde features update --- Cargo.lock | 4 + datatypes/Cargo.toml | 1 + .../src/collections/feature_collection.rs | 109 +++++++++++++-- .../mock/mock_feature_collection_source.rs | 132 ++++++++++-------- 4 files changed, 180 insertions(+), 66 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 70dd7a83d..4e725c3bf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -744,6 +744,9 @@ name = "arrow-schema" version = "53.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c85320a3a2facf2b2822b57aa9d6d9d55edb8aee0b6b5d3b8df158e503d10858" +dependencies = [ + "serde", +] [[package]] name = "arrow-select" @@ -2770,6 +2773,7 @@ dependencies = [ "arrow", "arrow-array", "arrow-ord", + "arrow-schema", "bytes", "chrono", "criterion", diff --git a/datatypes/Cargo.toml b/datatypes/Cargo.toml index 9c4f0a6d0..9cdfe4b57 100644 --- a/datatypes/Cargo.toml +++ b/datatypes/Cargo.toml @@ -16,6 +16,7 @@ pro = [] arrow = { version = "53.0", features = ["ipc_compression"] } arrow-array = "53.0" arrow-ord = "53.0" +arrow-schema = { version = "53", features = ["serde"] } bytes = "1.5" # for postgres-types impls chrono = "0.4" fallible-iterator = "0.2" # only for postgres-protocol diff --git a/datatypes/src/collections/feature_collection.rs b/datatypes/src/collections/feature_collection.rs index ac778afca..728bb5a4e 100644 --- a/datatypes/src/collections/feature_collection.rs +++ b/datatypes/src/collections/feature_collection.rs @@ -1515,7 +1515,6 @@ mod struct_serde { use serde::de::{SeqAccess, Visitor}; use serde::ser::Error; use serde::{Deserializer, Serializer}; - use std::fmt::Formatter; use std::io::Cursor; @@ -1599,6 +1598,97 @@ mod struct_serde { self.visit_byte_buf(bytes) } } + + #[cfg(test)] + pub fn serialize_json(struct_array: &StructArray, serializer: S) -> Result + where + S: Serializer, + { + use serde::ser::SerializeStruct; + + let batch = RecordBatch::from(struct_array); + + let mut json_writer = arrow::json::ArrayWriter::new(Vec::::new()); + json_writer.write(&batch).map_err(S::Error::custom)?; + json_writer.finish().map_err(S::Error::custom)?; + let json: serde_json::Value = + serde_json::from_slice(&json_writer.into_inner()).map_err(S::Error::custom)?; + + let mut struct_serializer = serializer.serialize_struct("FeatureCollection", 2)?; + struct_serializer.serialize_field("schema", batch.schema_ref())?; + struct_serializer.serialize_field("data", &json)?; + struct_serializer.end() + } + + #[cfg(test)] + pub fn deserialize_json<'de, D>(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + use std::io::BufReader; + + struct StructArrayJsonDeserializer; + + impl<'de> Visitor<'de> for StructArrayJsonDeserializer { + type Value = StructArray; + + fn expecting(&self, formatter: &mut Formatter) -> std::fmt::Result { + formatter.write_str("an Arrow StructArray") + } + + fn visit_map(self, mut map: A) -> Result + where + A: serde::de::MapAccess<'de>, + { + use serde::de::Error; + + let (mut schema, mut data) = (None, None); + + while let Some(key) = map.next_key()? { + match key { + "schema" => { + schema = Some(map.next_value::()?); + } + "data" => { + let value = map.next_value::()?; + data = Some(serde_json::to_vec(&value).map_err(A::Error::custom)?); + } + other => return Err(A::Error::custom(format!("Unexpected field {other}"))), + } + } + + let (Some(schema), Some(data)) = (schema, data) else { + return Err(A::Error::custom("Missing fields `schema` & `data`")); + }; + + let mut reader = arrow::json::ReaderBuilder::new(Arc::new(schema)) + .build(BufReader::new(Cursor::new(&data))) + .map_err(A::Error::custom)?; + + let batch = reader + .next() + .ok_or_else(|| { + A::Error::custom( + "Must be one batch inside the serialized data. Found none.", + ) + })? + .map_err(A::Error::custom)?; + if reader.next().is_some() { + return Err(A::Error::custom( + "Must be one batch inside the serialized data. Found more.", + )); + } + + Ok(batch.into()) + } + } + + deserializer.deserialize_struct( + "FeatureCollection", + &["schema", "data"], + StructArrayJsonDeserializer, + ) + } } impl Reproject

for FeatureCollection @@ -1766,10 +1856,9 @@ mod tests { .is_err()); } + /// If this test fails, change serialization to JSON (cf. methods below) instead of IPC. #[test] fn it_does_not_json_serialize() { - use arrow::record_batch::RecordBatch; - let collection = FeatureCollection::::from_data( vec![(0.0, 0.1).into()], vec![TimeInterval::new(0, 1).unwrap(); 1], @@ -1786,11 +1875,13 @@ mod tests { let struct_array = collection.table; - // TODO: if this stops failing, change the strange custom byte serialization to use JSON - let json = Vec::new(); - let mut json_writer = arrow::json::ArrayWriter::new(json); - json_writer - .write(&RecordBatch::from(struct_array)) - .unwrap_err(); + let serialized_struct_array = + struct_serde::serialize_json(&struct_array, serde_json::value::Serializer) + .unwrap() + .to_string(); + + let mut deserializer = serde_json::Deserializer::from_str(&serialized_struct_array); + + assert!(struct_serde::deserialize_json(&mut deserializer).is_err()); } } diff --git a/operators/src/mock/mock_feature_collection_source.rs b/operators/src/mock/mock_feature_collection_source.rs index 5594bcdcc..4950693cc 100644 --- a/operators/src/mock/mock_feature_collection_source.rs +++ b/operators/src/mock/mock_feature_collection_source.rs @@ -251,6 +251,7 @@ mod tests { use geoengine_datatypes::{collections::MultiPointCollection, primitives::SpatialResolution}; #[test] + #[allow(clippy::too_many_lines)] fn serde() { let cache_hint = CacheHint::default(); let collection = MultiPointCollection::from_data( @@ -272,64 +273,81 @@ mod tests { let serialized = serde_json::to_value(&source).unwrap(); let collection_bytes = [ - 65, 82, 82, 79, 87, 49, 0, 0, 255, 255, 255, 255, 184, 1, 0, 0, 16, 0, 0, 0, 0, 0, 10, - 0, 12, 0, 10, 0, 9, 0, 4, 0, 10, 0, 0, 0, 16, 0, 0, 0, 0, 1, 4, 0, 8, 0, 8, 0, 0, 0, 4, - 0, 8, 0, 0, 0, 4, 0, 0, 0, 3, 0, 0, 0, 180, 0, 0, 0, 56, 0, 0, 0, 4, 0, 0, 0, 52, 255, - 255, 255, 16, 0, 0, 0, 24, 0, 0, 0, 0, 0, 1, 2, 20, 0, 0, 0, 172, 255, 255, 255, 64, 0, - 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 6, 0, 0, 0, 102, 111, 111, 98, 97, 114, 0, 0, 152, 255, - 255, 255, 24, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 16, 76, 0, 0, 0, 1, 0, 0, 0, 12, 0, 0, 0, - 82, 255, 255, 255, 2, 0, 0, 0, 136, 255, 255, 255, 24, 0, 0, 0, 32, 0, 0, 0, 0, 0, 1, - 2, 28, 0, 0, 0, 8, 0, 12, 0, 4, 0, 11, 0, 8, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 4, 0, 0, 0, 105, 116, 101, 109, 0, 0, 0, 0, 6, 0, 0, 0, 95, 95, 116, 105, 109, 101, - 0, 0, 16, 0, 20, 0, 16, 0, 0, 0, 15, 0, 4, 0, 0, 0, 8, 0, 16, 0, 0, 0, 28, 0, 0, 0, 12, - 0, 0, 0, 0, 0, 0, 12, 160, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0, 4, 0, 4, 0, 4, 0, 0, 0, - 16, 0, 20, 0, 16, 0, 14, 0, 15, 0, 4, 0, 0, 0, 8, 0, 16, 0, 0, 0, 32, 0, 0, 0, 12, 0, - 0, 0, 0, 0, 1, 16, 96, 0, 0, 0, 1, 0, 0, 0, 36, 0, 0, 0, 0, 0, 6, 0, 8, 0, 4, 0, 6, 0, - 0, 0, 2, 0, 0, 0, 16, 0, 22, 0, 16, 0, 14, 0, 15, 0, 4, 0, 0, 0, 8, 0, 16, 0, 0, 0, 24, - 0, 0, 0, 28, 0, 0, 0, 0, 0, 1, 3, 24, 0, 0, 0, 0, 0, 6, 0, 8, 0, 6, 0, 6, 0, 0, 0, 0, - 0, 2, 0, 0, 0, 0, 0, 4, 0, 0, 0, 105, 116, 101, 109, 0, 0, 0, 0, 4, 0, 0, 0, 105, 116, - 101, 109, 0, 0, 0, 0, 10, 0, 0, 0, 95, 95, 103, 101, 111, 109, 101, 116, 114, 121, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 0, 0, 0, 52, 255, 255, 255, 16, 0, 0, 0, 24, 0, 0, 0, 0, 0, 1, 2, - 20, 0, 0, 0, 172, 255, 255, 255, 64, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 6, 0, 0, 0, 102, - 111, 111, 98, 97, 114, 0, 0, 152, 255, 255, 255, 24, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 16, - 76, 0, 0, 0, 1, 0, 0, 0, 12, 0, 0, 0, 82, 255, 255, 255, 2, 0, 0, 0, 136, 255, 255, - 255, 24, 0, 0, 0, 32, 0, 0, 0, 0, 0, 1, 2, 28, 0, 0, 0, 8, 0, 12, 0, 4, 0, 11, 0, 8, 0, - 0, 0, 64, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 4, 0, 0, 0, 105, 116, 101, 109, 0, 0, 0, 0, - 6, 0, 0, 0, 95, 95, 116, 105, 109, 101, 0, 0, 16, 0, 20, 0, 16, 0, 0, 0, 15, 0, 4, 0, - 0, 0, 8, 0, 16, 0, 0, 0, 28, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 12, 160, 0, 0, 0, 1, 0, 0, - 0, 28, 0, 0, 0, 4, 0, 4, 0, 4, 0, 0, 0, 16, 0, 20, 0, 16, 0, 14, 0, 15, 0, 4, 0, 0, 0, - 8, 0, 16, 0, 0, 0, 32, 0, 0, 0, 12, 0, 0, 0, 0, 0, 1, 16, 96, 0, 0, 0, 1, 0, 0, 0, 36, - 0, 0, 0, 0, 0, 6, 0, 8, 0, 4, 0, 6, 0, 0, 0, 2, 0, 0, 0, 16, 0, 22, 0, 16, 0, 14, 0, - 15, 0, 4, 0, 0, 0, 8, 0, 16, 0, 0, 0, 24, 0, 0, 0, 28, 0, 0, 0, 0, 0, 1, 3, 24, 0, 0, - 0, 0, 0, 6, 0, 8, 0, 6, 0, 6, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 4, 0, 0, 0, 105, 116, - 101, 109, 0, 0, 0, 0, 4, 0, 0, 0, 105, 116, 101, 109, 0, 0, 0, 0, 10, 0, 0, 0, 95, 95, - 103, 101, 111, 109, 101, 116, 114, 121, 0, 0, 1, 0, 0, 0, 200, 1, 0, 0, 0, 0, 0, 0, - 128, 1, 0, 0, 0, 0, 0, 0, 184, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 1, 0, 0, 65, 82, - 82, 79, 87, 49, + 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 184, 1, 0, 0, 16, 0, 0, 0, 0, 0, 10, 0, 12, + 0, 10, 0, 9, 0, 4, 0, 10, 0, 0, 0, 16, 0, 0, 0, 0, 1, 4, 0, 8, 0, 8, 0, 0, 0, 4, 0, 8, + 0, 0, 0, 4, 0, 0, 0, 3, 0, 0, 0, 180, 0, 0, 0, 56, 0, 0, 0, 4, 0, 0, 0, 52, 255, 255, + 255, 16, 0, 0, 0, 24, 0, 0, 0, 0, 0, 1, 2, 20, 0, 0, 0, 172, 255, 255, 255, 64, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 0, 6, 0, 0, 0, 102, 111, 111, 98, 97, 114, 0, 0, 152, 255, 255, + 255, 24, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 16, 76, 0, 0, 0, 1, 0, 0, 0, 12, 0, 0, 0, 82, + 255, 255, 255, 2, 0, 0, 0, 136, 255, 255, 255, 24, 0, 0, 0, 32, 0, 0, 0, 0, 0, 1, 2, + 28, 0, 0, 0, 8, 0, 12, 0, 4, 0, 11, 0, 8, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, + 4, 0, 0, 0, 105, 116, 101, 109, 0, 0, 0, 0, 6, 0, 0, 0, 95, 95, 116, 105, 109, 101, 0, + 0, 16, 0, 20, 0, 16, 0, 0, 0, 15, 0, 4, 0, 0, 0, 8, 0, 16, 0, 0, 0, 28, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 12, 160, 0, 0, 0, 1, 0, 0, 0, 28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, 0, 16, 76, 0, 0, 0, 1, 0, 0, 0, 12, + 0, 0, 0, 82, 255, 255, 255, 2, 0, 0, 0, 136, 255, 255, 255, 24, 0, 0, 0, 32, 0, 0, 0, + 0, 0, 1, 2, 28, 0, 0, 0, 8, 0, 12, 0, 4, 0, 11, 0, 8, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 1, + 0, 0, 0, 0, 4, 0, 0, 0, 105, 116, 101, 109, 0, 0, 0, 0, 6, 0, 0, 0, 95, 95, 116, 105, + 109, 101, 0, 0, 16, 0, 20, 0, 16, 0, 0, 0, 15, 0, 4, 0, 0, 0, 8, 0, 16, 0, 0, 0, 28, 0, + 0, 0, 12, 0, 0, 0, 0, 0, 0, 12, 160, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0, 4, 0, 4, 0, 4, + 0, 0, 0, 16, 0, 20, 0, 16, 0, 14, 0, 15, 0, 4, 0, 0, 0, 8, 0, 16, 0, 0, 0, 32, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 1, 16, 96, 0, 0, 0, 1, 0, 0, 0, 36, 0, 0, 0, 0, 0, 6, 0, 8, 0, 4, 0, + 6, 0, 0, 0, 2, 0, 0, 0, 16, 0, 22, 0, 16, 0, 14, 0, 15, 0, 4, 0, 0, 0, 8, 0, 16, 0, 0, + 0, 24, 0, 0, 0, 28, 0, 0, 0, 0, 0, 1, 3, 24, 0, 0, 0, 0, 0, 6, 0, 8, 0, 6, 0, 6, 0, 0, + 0, 0, 0, 2, 0, 0, 0, 0, 0, 4, 0, 0, 0, 105, 116, 101, 109, 0, 0, 0, 0, 4, 0, 0, 0, 105, + 116, 101, 109, 0, 0, 0, 0, 10, 0, 0, 0, 95, 95, 103, 101, 111, 109, 101, 116, 114, 121, + 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 128, 1, 0, 0, 0, 0, 0, 0, 128, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 204, 1, 0, 0, 65, 82, 82, 79, 87, 49, ] .to_vec(); assert_eq!(