ChoETL
ChoETL copied to clipboard
Parquet: converting flattened object back to complex POCO type
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
pls post sample json.