Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-17458

[C++] CSV Writer: Unsupported cast from decimal to utf8

    XMLWordPrintableJSON

Details

    Description

      The following code snippet fails with an Unsupported cast error if a table has a decimal column.

      std::shared_ptr<arrow::Table> table;
      ARROW_CHECK_OK(reader->ReadAll(&table));
      
      std::shared_ptr<arrow::io::OutputStream> output = arrow::io::FileOutputStream::Open(csvPath).ValueOrDie();
      auto writeOptions = arrow::csv::WriteOptions::Defaults();
      writeOptions.include_header = false;
      auto status = arrow::csv::WriteCSV(*table, writeOptions, output.get());
      if (!status.ok()) {
          SETHROW_ERROR(std::runtime_error, "Couldn't write table csv: {}", status.message());
      }
      
      Unsupported cast from decimal128(7, 2) to utf8 using function cast_string
      

      Attachments

        Issue Links

          Activity

            People

              quanghgx Quang Hoang
              jokser Pavel Kovalenko
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m