Re: Can't deserialize Arrow Schema with empty metadata?

2021-04-05 Thread Jack Chan
Schema::empty() serializes to "{\"fields\":[]}". Metadata is not present because of skip_serializing_if. This is the error that would be given if the above string is deserialized:

Re: Can't deserialize Arrow Schema with empty metadata?

2021-04-05 Thread Andrew Lamb
Did the metadata successfully serialize with serde json (this is a little unclear to me given your description). > I would expect that every schema can be serialized-deserialized back in itself. I have the same expectation. If metadata can't be serialized with serde_json that would seem like a b

Re: Can't deserialize Arrow Schema with empty metadata?

2021-04-04 Thread Jack Chan
Indeed, I did, with both serde json and dynamodb. Inside an arrow schema, the metadata field is a hashmap with skip serializing if empty. When deserializing, it expects a metadata field. I would expect that every schema can be serialized-deserialized back in itself. Jack On Sat, Apr 3, 2021, 10:5

Re: Can't deserialize Arrow Schema with empty metadata?

2021-04-03 Thread Andrew Lamb
This looks like a rust program. Perhaps you could try using `serde_json` or some other format to narrow down where the issue is On Fri, Apr 2, 2021 at 10:00 PM Jack Chan wrote: > Hi > > I tried to serialize and deserialize an arrow schema, but I got into an > error of > (Error { message: "missin

Can't deserialize Arrow Schema with empty metadata?

2021-04-02 Thread Jack Chan
Hi I tried to serialize and deserialize an arrow schema, but I got into an error of (Error { message: "missing field `metadata`" }). Is this a bug in apache arrow or in serde_dynamodb? ``` let schema = ArrowSchema::empty(); let object = serde_dynamodb::to_hashmap(&schema)?;