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

[Rust] Return error messages via Result for get_arrow_schema_from_metadata

    XMLWordPrintableJSON

Details

    Description

      While converting from the parquet schema to arrow schema some errors, including those during flatbuffer decoding, can be lost.

      This is due to get_arrow_schema_from_metadata returning `Option` rather than `Result`

      https://github.com/apache/arrow/pull/8936/files# improved the situation by printing the error to stdout, so the error isn't entirely lost, but this message should be propagated up the call chain as a proper Rust error via a Result.

                  match arrow::ipc::root_as_message(slice) {
                      Ok(message) => message
                          .header_as_schema()
                          .map(arrow::ipc::convert::fb_to_schema),
                      Err(err) => {
                          // The flatbuffers implementation returns an error on verification error.
                          // TODO: return error to caller?
                          eprintln!(
                              "Unable to get root as message stored in {}: {:?}",
                              super::ARROW_SCHEMA_META_KEY,
                              err
                          );
                          None
                      }
                  }
      

      Attachments

        Issue Links

          Activity

            People

              mqy Qingyou Meng
              alamb Andrew Lamb
              Votes:
              0 Vote for this issue
              Watchers:
              3 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 - 3h 20m
                  3h 20m