add SchemaSpec trait to specify how to read or write data