ChoETL icon indicating copy to clipboard operation
ChoETL copied to clipboard

Parquet: converting flattened object back to complex POCO type

Open mbiot opened this issue 3 years ago • 1 comments

Hello,

I'm writing a complex POCO (nested types) object to a parquet file as follow:

using (var r = ChoJSONReader<Request>.LoadText(File.ReadAllText("request.json")).UseJsonSerialization())
{
    using (var w = new ChoParquetWriter("request.parquet"))
    {
        w.Write(r.Select(x => x.FlattenToDictionary()));
    }
}

Which is working fine. I'm now trying to read it back to my POCO object but I can't find any way to "unflatten" it. I've tried this, without success:

using (var reader = new ChoParquetReader("request.parquet"))
{
    var result = reader.Read();
    Request request = result.ConvertToObject<Request>(); // <= not working :(
}

Would greatly appreciate any help!

Thanks

mbiot avatar Oct 08 '22 18:10 mbiot

pls post sample json.

Cinchoo avatar Oct 11 '22 11:10 Cinchoo