apache / arrow-rs

Official Rust implementation of Apache Arrow
https://arrow.apache.org/
Apache License 2.0
2.63k stars 803 forks source link

`PartialEq` of GenericByteViewArray (StringViewArray / ByteViewArray) that compares on equality rather than logical value #6679

Closed alamb closed 2 weeks ago

alamb commented 3 weeks ago

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

Comparing two GenericByteViewArray using PartialEq compares by structure (the u128s) and contents of the buffers, not by logical content. As there

As @tustvold points out on https://github.com/apache/arrow-rs/pull/6673/files#r1827839121 this is inconsistent with how PartialEq is implemented for other arrays, which compare based on ArrayData which compares based on equality:

https://github.com/apache/arrow-rs/blob/ebcc4a585136cd1d9696c38c41f71c9ced181f57/arrow-data/src/data.rs#L1777-L1781

Describe the solution you'd like Implement PartialEq for GenericByteViewArray that compares two arrays on logical value rather than physical representation

Describe alternatives you've considered Add manual impl of PartialEq to GenericByteViewArray

Additional context

tlm365 commented 2 weeks ago

take

alamb commented 1 week ago

label_issue.py automatically added labels {'documentation'} from #6673

alamb commented 1 week ago

label_issue.py automatically added labels {'arrow'} from #6673