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

[Rust] Debug formatting arrays with lengths greater than 10 and less than 20 produces incorrect values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.0.0
    • Rust

    Description

      Debug printing arrays with lengths greater than 10 and less than 20 may duplicate some values in the output. 

      Example: Array with 10 elements

      This example demonstrates printing with the correct output. 

      println!("{:?}", Int32Array::from(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
      

      Output:

      PrimitiveArray<Int32>
      [
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
      ]
      

      Example: Array with 11 elements

      This example demonstrates printing with an unexpected output.

      println!("{:?}", Int32Array::from(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]));
      

      Actual Output:

      PrimitiveArray<Int32>
      [
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
      ]
      

      Expected Output:

      PrimitiveArray<Int32>
      [
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
      ]
      

      Attachments

        Issue Links

          Activity

            People

              drusso Daniel Russo
              drusso Daniel Russo
              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 - 10m
                  10m