[ 
https://issues.apache.org/jira/browse/ARROW-7030?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

wjw updated ARROW-7030:
-----------------------
    Summary: [C++] CSV example coredump error  (was: csv example coredump error)

> [C++] CSV example coredump error
> --------------------------------
>
>                 Key: ARROW-7030
>                 URL: https://issues.apache.org/jira/browse/ARROW-7030
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++
>    Affects Versions: 0.15.0
>         Environment: g++:7.3.1
>            Reporter: wjw
>            Priority: Blocker
>
> I am trying to write a example for reading csv by apache-arrow in c++ 
> according to the offical one,[https://arrow.apache.org/docs/cpp/csv.html#], 
> but it meets Segmentation fault at *`status = reader->Read(&table);`*
> Can anyone help? thank you~
>  
> *environment info:*
>  `g++:7.3.1`
> *make command:*
>  `c++ -g -std=c++11 -Wall -O2 test.cpp -o test -I../../arrow/src 
> -L../../arrow/lib -larrow -lparquet -Wl,-rpath,./`
> *code info:*
>  ```
>  arrow::Status status;
>  arrow::MemoryPool *pool = arrow::default_memory_pool();
>  std::shared_ptr<arrow::io::InputStream> input;
>  std::string csv_file = "test.csv";
>  auto input_readable = 
> std::dynamic_pointer_cast<arrow::io::ReadableFile>(input);
>  PARQUET_THROW_NOT_OK(arrow::io::ReadableFile::Open(csv_file, pool, 
> &input_readable));
> auto read_options = arrow::csv::ReadOptions::Defaults();
>  read_options.use_threads = false;
>  read_options.column_names.emplace_back("name");
>  read_options.column_names.emplace_back("age");
> auto parse_options = arrow::csv::ParseOptions::Defaults();
> auto convert_options = arrow::csv::ConvertOptions::Defaults();
>  convert_options.include_missing_columns = true;
> std::shared_ptr<arrow::csv::TableReader> reader;
>  status = arrow::csv::TableReader::Make(pool, input, read_options,
>  parse_options, convert_options,
>  &reader);
>  if (!status.ok())
> { std::cout << "make csv table error" << std::endl; return -1; }
> std::shared_ptr<arrow::Table> table;
>  status = reader->Read(&table);
>  if (!status.ok())
> { std::cout << "read csv table error" << std::endl; return -1; }
> ```
> *coredump info:*
>  ```
>  Program terminated with signal 11, Segmentation fault.
>  #0 0x00007fe4fcda83e7 in 
> arrow::io::internal::ReadaheadSpooler::Impl::WorkerLoop() () from 
> ./libarrow.so.15
>  (gdb) bt
>  #0 0x00007fe4fcda83e7 in 
> arrow::io::internal::ReadaheadSpooler::Impl::WorkerLoop() () from 
> ./libarrow.so.15
>  #1 0x00007fe4fd405a2f in execute_native_thread_routine () from 
> ./libarrow.so.15
>  #2 0x00007fe4fa8ecdf3 in start_thread () from /lib64/libpthread.so.0
>  #3 0x00007fe4fb86e1bd in clone () from /lib64/libc.so.6
>  ```
>  
> *csv info:*
> name,age
>  aaa,12
>  bbb,13
>  ccc,14
>  ddd,15



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

Reply via email to