arrow-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Pitrou <>
Subject Re: C++ ARROW_DEPRECATED Use MemoryPool-less variant
Date Tue, 08 Jun 2021 13:00:49 GMT
On Tue, 8 Jun 2021 12:32:23 +0000
"Weber, Eugene" <> wrote:
> When I compile under cpp/examples/minimal_build I get a depreciation warning
>       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>
>       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.



View raw message