snizovtsev commented on issue #31186:
URL: https://github.com/apache/arrow/issues/31186#issuecomment-1418066984

   I stuck on the same issue. Its very annoying.
   
   Reproducer:
   ```cpp
   #include <arrow/api.h>
   #include <arrow/csv/api.h>
   #include <arrow/io/api.h>
   
   #include <iostream>
   
   arrow::Status RunMain() {
       std::shared_ptr<arrow::Table> lrn;
   
       arrow::io::ReadableFile rf;
   
       std::cerr << "begin" << std::endl;
       //ARROW_ASSIGN_OR_RAISE(auto lrn_file, arrow::io::ReadableFile::Open(3));
       ARROW_ASSIGN_OR_RAISE(auto lrn_file, 
arrow::io::ReadableFile::Open("/dev/fd/0"));
       //auto lrn_file = std::make_shared<arrow::io::StdinStream>();
   
       std::cerr << "open csv" << std::endl;
       ARROW_ASSIGN_OR_RAISE(auto lrn_reader,
           arrow::csv::TableReader::Make(
               arrow::io::default_io_context(), lrn_file, 
arrow::csv::ReadOptions::Defaults(),
               arrow::csv::ParseOptions::Defaults(), 
arrow::csv::ConvertOptions::Defaults()));
       std::cerr << "read table" << std::endl;
       ARROW_ASSIGN_OR_RAISE(lrn, lrn_reader->Read());
   
       std::cerr << "#rows: " << lrn->num_rows() << std::endl;
       std::cerr << "#cols: " << lrn->num_columns() << std::endl;
   
       return arrow::Status::OK();
   }
   
   int main() {
     arrow::Status st = RunMain();
     if (!st.ok()) {
       std::cerr << st << std::endl;
       return 1;
     }
     return 0;
   }
   ```
   
   Test output:
   ```
   $ cat test.csv | store/builder
   begin
   IOError: lseek failed
   $ store/builder < test.csv
   begin
   open csv
   read table
   #rows: 9
   #cols: 2
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to