Skip to content

Bug in PartialEq for Struct #706

@Sl1mb0

Description

@Sl1mb0

Problem

If I write a Manifest to an output.avro file and then read that same output.avro file into another Manifest object, asserting that the two objects are equal fails due to inequality between the partition fields of each Manifest:

Example

// Write manifest
let manifest_list_entry = manifest_writer.write(input_manifest.clone()).await.unwrap();

// Assert that the manifest path exists.
let manifest_path = PathBuf::from(manifest_list_entry.manifest_path);
assert!(manifest_path.exists());

// Assert that manifest file can be parsed back into a `Manifest` struct.
let buf = std::fs::read(&manifest_path).unwrap();
let output_manifest = Manifest::parse_avro(&buf).unwrap();

// ..
// Assert that all other fields are equal
// ..

// Fails
assert_eq!(file1.partition(), file2.partition());

Output

assertion `left == right` failed
  left: Struct { fields: [Primitive(Boolean(true))], null_bitmap: BitVec<usize, bitvec::order::Lsb0> { addr: 0x78a7fc007210, head: 000000, bits: 1, capacity: 64 } [0] }
 right: Struct { fields: [], null_bitmap: BitVec<usize, bitvec::order::Lsb0> { addr: 0x8, head: 000000, bits: 0, capacity: 0 } [] }

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions