Jefffrey commented on code in PR #12463:
URL: https://github.com/apache/arrow-rs/pull/12463#discussion_r4694943092
##########
arrow-array/src/builder/generic_bytes_dictionary_builder.rs:
##########
@@ -275,7 +275,9 @@ where
)
.or_insert_with(|| {
let idx = storage.len();
- storage.append_value(value);
+ // Store the bytes that were hashed above, not a second
s_ref()
+ // of alue, which is not required to be idempotent.
Review Comment:
```suggestion
```
not necessary
##########
arrow-array/src/builder/generic_bytes_dictionary_builder.rs:
##########
Review Comment:
we should just shadow this like
```rust
let value: &T::Native = value.as_ref();
```
##########
arrow-array/src/builder/generic_bytes_dictionary_builder.rs:
##########
@@ -670,14 +672,41 @@ pub type LargeBinaryDictionaryBuilder<K> =
GenericByteDictionaryBuilder<K, Gener
mod tests {
use super::*;
- use crate::array::Int8Array;
+ use std::cell::Cell;
+
+ use crate::array::{Int8Array, Int32Array};
use crate::cast::AsArray;
use crate::types::{
BinaryType, Int8Type, Int16Type, Int32Type, UInt8Type, UInt16Type,
Utf8Type,
};
use crate::{ArrowPrimitiveType, BinaryArray, StringArray};
use arrow_schema::DataType;
+ /// A legal `AsRef<str>` whose result changes between calls, so the value
+ /// that is hashed can differ from the value that is stored.
+ struct AlternatingValue(Cell<u32>);
Review Comment:
this is overkill and unnecessary, please remove these tests
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]