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

[Rust] Concat kernel panics on slices of string arrays

    XMLWordPrintableJSON

Details

    Description

      See the test case below:

      #[test]
      fn test_string_array_slices() -> Result<()> {
          let input_1 = StringArray::from(vec!["hello", "A", "B", "C"]);
          let input_2 = StringArray::from(vec!["world", "D", "E", "Z"]);
      
          let arr = concat(&[
              input_1.slice(1, 3).as_ref(),
              input_2.slice(1, 2).as_ref(),
          ])?;
      
          let expected_output = StringArray::from(vec!["A", "B", "C", "D", "E"]);
      
          let actual_output = arr
              .as_any()
              .downcast_ref::<StringArray>()
              .unwrap();
          assert_eq!(actual_output, &expected_output);
      
          Ok(())
      }

      Fails with:

      range end index 8 out of range for slice of length 7
      thread 'compute::kernels::concat::tests::test_string_array_slices' panicked at 'range end index 8 out of range for slice of length 7', arrow/src/array/transform/variable_size.rs:38:23
      

      Attachments

        Issue Links

          Activity

            People

              bchambers Ben Chambers
              bchambers Ben Chambers
              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 - 50m
                  50m