[
https://issues.apache.org/jira/browse/ARROW-7030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16963016#comment-16963016
]
wjw edited comment on ARROW-7030 at 10/30/19 1:28 PM:
------------------------------------------------------
[~wesm] yes~I got it from the master branch 0.15.0~
I hava resolved this problem by changing the type of `input` to ReadableFile
directly~
another question, now I can't get the whole parquet file in the memory, only
can fetch it slice by slice from the network, so how can I use arrow to read
the parquet file?
thank you~
was (Author: annsshadow):
yes~I got it from the master branch 0.15.0~
I hava resolved this problem by changing the type of `input` to ReadableFile
directly~
another question, now I can't get the whole parquet file in the memory, only
can fetch it slice by slice from the network, so how can I use arrow to read
the parquet file?
thank you~
> [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)