On Tue, 8 Jun 2021 15:00:49 +0200 Antoine Pitrou <[email protected]> wrote: > On Tue, 8 Jun 2021 12:32:23 +0000 > "Weber, Eugene" <[email protected]> wrote: > > > > When I compile example.cc under cpp/examples/minimal_build I get a > > depreciation warning on: > > > > arrow::csv::TableReader::Make(arrow::default_memory_pool(), > > arrow::io::default_io_context(), > > input_file, > > arrow::csv::ReadOptions::Defaults(), > > arrow::csv::ParseOptions::Defaults(), > > > > arrow::csv::ConvertOptions::Defaults())); > > > > The deprecation code in reader.h is: > > > > ARROW_DEPRECATED("Use MemoryPool-less variant (the IOContext holds a pool > > already)") > > static Result<std::shared_ptr<TableReader>> Make( > > MemoryPool* pool, io::IOContext io_context, > > std::shared_ptr<io::InputStream> input, > > const ReadOptions&, const ParseOptions&, const ConvertOptions&); > > > > I've read the documentation on MemoryPool, but I'm still not fully > > understanding the relationship between TableReader and MemoryPool, or how > > exactly to correct the example code. I understand that the CVS table is > > read into a table structure in memory allocated from the memory pool. I'm > > not understanding the meaning of "Use MemoryPool-less variant (the > > IOContext holds a pool already)". > > What it means is that you don't need to pass a memory pool explicitly, > since the IOContext parameter already has a memory pool inside. > > That said, it seems the example code should be updated for the newer > API. Thanks for noticing this.
This PR fixes the example code: https://github.com/apache/arrow/pull/10481 Regards Antoine.
