This is an automated email from the ASF dual-hosted git repository.
tustvold pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/master by this push:
new ada7fb651 rename function (#1889)
ada7fb651 is described below
commit ada7fb65146c1083b9402c0f5603563dd89a0a57
Author: Andrey Frolov <[email protected]>
AuthorDate: Thu Jun 16 23:18:26 2022 +0300
rename function (#1889)
---
arrow/src/array/array_dictionary.rs | 4 ++--
arrow/src/array/data.rs | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/arrow/src/array/array_dictionary.rs
b/arrow/src/array/array_dictionary.rs
index b967b3abb..0fbd5a34e 100644
--- a/arrow/src/array/array_dictionary.rs
+++ b/arrow/src/array/array_dictionary.rs
@@ -114,11 +114,11 @@ impl<'a, K: ArrowPrimitiveType> DictionaryArray<K> {
}
// Safety: `validate` ensures key type is correct, and
- // `validate_dictionary_offset` ensures all offsets are within range
+ // `validate_values` ensures all offsets are within range
let array = unsafe { data.build_unchecked() };
array.validate()?;
- array.validate_dictionary_offset()?;
+ array.validate_values()?;
Ok(array.into())
}
diff --git a/arrow/src/array/data.rs b/arrow/src/array/data.rs
index 65fbc4df9..3e7e66496 100644
--- a/arrow/src/array/data.rs
+++ b/arrow/src/array/data.rs
@@ -985,7 +985,7 @@ impl ArrayData {
)));
}
- self.validate_dictionary_offset()?;
+ self.validate_values()?;
// validate all children recursively
self.child_data
@@ -1003,7 +1003,7 @@ impl ArrayData {
Ok(())
}
- pub fn validate_dictionary_offset(&self) -> Result<()> {
+ pub fn validate_values(&self) -> Result<()> {
match &self.data_type {
DataType::Decimal(p, _) => {
let values_buffer: &[i128] = self.typed_buffer(0, self.len)?;
@@ -2770,7 +2770,7 @@ mod tests {
)
};
- let err = data.validate_dictionary_offset().unwrap_err();
+ let err = data.validate_values().unwrap_err();
assert_eq!(err.to_string(), "Invalid argument error: Offset invariant
failure: offset at position 1 out of bounds: 3 > 2");
}
}