You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/07/28 12:35:47 UTC

[GitHub] [arrow-rs] jhorstmann opened a new issue #626: ListArray equals should not consider nested values if element is marked as null

jhorstmann opened a new issue #626:
URL: https://github.com/apache/arrow-rs/issues/626


   **Describe the bug**
   
   I would expect the following test case to pass. In both arrays the second element is marked as null and so they should compare equal.
   
   ```
   #[test]
   fn test_list_array_equal() {
       let mut builder = ListBuilder::new(Int64Builder::new(10));
       builder.values().append_value(1).unwrap();
       builder.values().append_value(2).unwrap();
       builder.values().append_value(3).unwrap();
       builder.append(true).unwrap();
       builder.append(false).unwrap();
       let array1 = builder.finish();
   
       let mut builder = ListBuilder::new(Int64Builder::new(10));
       builder.values().append_value(1).unwrap();
       builder.values().append_value(2).unwrap();
       builder.values().append_value(3).unwrap();
       builder.append(true).unwrap();
       builder.values().append_null().unwrap();
       builder.values().append_null().unwrap();
       builder.append(false).unwrap();
       let array2 = builder.finish();
   
       assert_eq!(array1, array2);
   }
   ```
   
   The output of the `assert_eq` also shows both sides the same:
   
   ```
   assertion failed: `(left == right)`
     left: `ListArray
   [
     PrimitiveArray<Int64>
   [
     1,
     2,
     3,
   ],
     null,
   ]`,
    right: `ListArray
   [
     PrimitiveArray<Int64>
   [
     1,
     2,
     3,
   ],
     null,
   ]`
   ```
   
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org