[ 
https://issues.apache.org/jira/browse/ARROW-8534?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17088410#comment-17088410
 ] 

Antoine Pitrou commented on ARROW-8534:
---------------------------------------

Could you please open a PR?

> [C++][CSV] Issue building CSV component under GCC 6.1.0
> -------------------------------------------------------
>
>                 Key: ARROW-8534
>                 URL: https://issues.apache.org/jira/browse/ARROW-8534
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++
>    Affects Versions: 0.17.0
>         Environment: Centos 7 x86_64
>            Reporter: Ross Wolfson
>            Priority: Minor
>
> Hi,
> In the current version (0.17.0), it seems that CSV reader.cc fails to compile 
> when using GCC 6.1.0. This builds when using older or newer GCC versions (we 
> tested with 4.8.5, 8.2.0 and 9.3.0).
>  
> {{[root@1d4fcfc2580e arrow_src]# /ourgcc/gcc-6.1.0/bin/g++ -c 
> cpp/src/arrow/csv/reader.cc -I cpp/src}}
> {{cpp/src/arrow/csv/reader.cc: In constructor 
> 'arrow::csv::SerialBlockReader::SerialBlockReader(std::unique_ptr<arrow::Chunker>,
>  arrow::Iterator<std::shared_ptr<arrow::Buffer> >, 
> std::shared_ptr<arrow::Buffer>)':}}
> {{cpp/src/arrow/csv/reader.cc:178:22: error: use of deleted function 
> 'std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) 
> [with _Tp = arrow::Chunker; _Dp = std::default_delete<arrow::Chunker>]'}}
> {{ using BlockReader::BlockReader;}}
> {{ ^~~~~~~~~~~}}
> {{In file included from /ourgcc/gcc-6.1.0/include/c++/6.1.0/memory:81:0,}}
> {{ from cpp/src/arrow/csv/reader.h:20,}}
> {{ from cpp/src/arrow/csv/reader.cc:18:}}
> {{/ourgcc/gcc-6.1.0/include/c++/6.1.0/bits/unique_ptr.h:356:7: note: declared 
> here}}
> {{ unique_ptr(const unique_ptr&) = delete;}}
> {{ ^~~~~~~~~~}}
> {{cpp/src/arrow/csv/reader.cc:178:22: error: use of deleted function 
> 'arrow::Iterator<std::shared_ptr<arrow::Buffer> >::Iterator(const 
> arrow::Iterator<std::shared_ptr<arrow::Buffer> >&)'}}
> {{ using BlockReader::BlockReader;}}
> {{ ^~~~~~~~~~~}}
> {{In file included from cpp/src/arrow/csv/reader.cc:43:0:}}
> {{cpp/src/arrow/util/iterator.h:63:7: note: 
> 'arrow::Iterator<std::shared_ptr<arrow::Buffer> >::Iterator(const 
> arrow::Iterator<std::shared_ptr<arrow::Buffer> >&)' is implicitly deleted 
> because the default definition would be ill-formed:}}
> {{ class Iterator : public util::EqualityComparable<Iterator<T>> {}}
> {{ ^~~~~~~~}}
> {{cpp/src/arrow/util/iterator.h:63:7: error: use of deleted function 
> 'std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) 
> [with _Tp = void; _Dp = void (*)(void*)]'}}
> {{In file included from /ourgcc/gcc-6.1.0/include/c++/6.1.0/memory:81:0,}}
> {{ from cpp/src/arrow/csv/reader.h:20,}}
> {{ from cpp/src/arrow/csv/reader.cc:18:}}
> {{/ourgcc/gcc-6.1.0/include/c++/6.1.0/bits/unique_ptr.h:356:7: note: declared 
> here}}
> {{ unique_ptr(const unique_ptr&) = delete;}}
> {{ ^~~~~~~~~~}}
> {{cpp/src/arrow/csv/reader.cc: In member function 'virtual 
> arrow::Result<std::shared_ptr<arrow::Table> > 
> arrow::csv::SerialTableReader::Read()':}}
> {{cpp/src/arrow/csv/reader.cc:750:88: note: synthesized method 
> 'arrow::csv::SerialBlockReader::SerialBlockReader(std::unique_ptr<arrow::Chunker>,
>  arrow::Iterator<std::shared_ptr<arrow::Buffer> >, 
> std::shared_ptr<arrow::Buffer>)' first required here}}
> {{ std::move(buffer_iterator_), std::move(first_buffer));}}
> {{ ^}}
> {{cpp/src/arrow/csv/reader.cc: In constructor 
> 'arrow::csv::ThreadedBlockReader::ThreadedBlockReader(std::unique_ptr<arrow::Chunker>,
>  arrow::Iterator<std::shared_ptr<arrow::Buffer> >, 
> std::shared_ptr<arrow::Buffer>)':}}
> {{cpp/src/arrow/csv/reader.cc:221:22: error: use of deleted function 
> 'std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) 
> [with _Tp = arrow::Chunker; _Dp = std::default_delete<arrow::Chunker>]'}}
> {{ using BlockReader::BlockReader;}}
> {{ ^~~~~~~~~~~}}
> {{In file included from /ourgcc/gcc-6.1.0/include/c++/6.1.0/memory:81:0,}}
> {{ from cpp/src/arrow/csv/reader.h:20,}}
> {{ from cpp/src/arrow/csv/reader.cc:18:}}
> {{/ourgcc/gcc-6.1.0/include/c++/6.1.0/bits/unique_ptr.h:356:7: note: declared 
> here}}
> {{ unique_ptr(const unique_ptr&) = delete;}}
> {{ ^~~~~~~~~~}}
> {{cpp/src/arrow/csv/reader.cc:221:22: error: use of deleted function 
> 'arrow::Iterator<std::shared_ptr<arrow::Buffer> >::Iterator(const 
> arrow::Iterator<std::shared_ptr<arrow::Buffer> >&)'}}
> {{ using BlockReader::BlockReader;}}
> {{ ^~~~~~~~~~~}}
> {{cpp/src/arrow/csv/reader.cc: In member function 'virtual 
> arrow::Result<std::shared_ptr<arrow::Table> > 
> arrow::csv::ThreadedTableReader::Read()':}}
> {{cpp/src/arrow/csv/reader.cc:815:61: note: synthesized method 
> 'arrow::csv::ThreadedBlockReader::ThreadedBlockReader(std::unique_ptr<arrow::Chunker>,
>  arrow::Iterator<std::shared_ptr<arrow::Buffer> >, 
> std::shared_ptr<arrow::Buffer>)' first required here}}
> {{ std::move(first_buffer));}}
> {{ ^}}
>  
> My colleague found a workaround that avoids the build error, however, we are 
> not clear if this is the "best" fix.
> {{--- a/cpp/src/arrow/csv/reader.cc}}
> {{+++ b/cpp/src/arrow/csv/reader.cc}}
> {{@@ -175,7 +175,12 @@ class BlockReader {}}
> {{ // using CSVBlock::consume_bytes.}}
> {{ class SerialBlockReader : public BlockReader {}}
> {{ public:}}
> {{- using BlockReader::BlockReader;}}
> {{+ SerialBlockReader(std::unique_ptr<Chunker> chunker,}}
> {{+ Iterator<std::shared_ptr<Buffer>> buffer_iterator,}}
> {{+ std::shared_ptr<Buffer> first_buffer)}}
> {{+ : BlockReader(std::move(chunker),}}
> {{+ std::move(buffer_iterator),}}
> {{+ std::move(first_buffer)) {}}}{{Result<arrow::util::optional<CSVBlock>> 
> Next() {}}
> {{ if (buffer_ == nullptr) {}}
> {{@@ -218,7 +223,12 @@ class SerialBlockReader : public BlockReader {}}
> {{ // An object that reads delimited CSV blocks for threaded use.}}
> {{ class ThreadedBlockReader : public BlockReader {}}
> {{ public:}}
> {{- using BlockReader::BlockReader;}}
> {{+ ThreadedBlockReader(std::unique_ptr<Chunker> chunker,}}
> {{+ Iterator<std::shared_ptr<Buffer>> buffer_iterator,}}
> {{+ std::shared_ptr<Buffer> first_buffer)}}
> {{+ : BlockReader(std::move(chunker),}}
> {{+ std::move(buffer_iterator),}}
> {{+ std::move(first_buffer)) {}}}{{Result<arrow::util::optional<CSVBlock>> 
> Next() {}}
> {{ if (buffer_ == nullptr) {}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to