Implement query result deserialization