Skip to content

Commit

Permalink
rename function (#1889)
Browse files Browse the repository at this point in the history
  • Loading branch information
frolovdev committed Jun 16, 2022
1 parent f159679 commit ada7fb6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions arrow/src/array/array_dictionary.rs
Expand Up @@ -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())
}
Expand Down
6 changes: 3 additions & 3 deletions arrow/src/array/data.rs
Expand Up @@ -985,7 +985,7 @@ impl ArrayData {
)));
}

self.validate_dictionary_offset()?;
self.validate_values()?;

// validate all children recursively
self.child_data
Expand All @@ -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)?;
Expand Down Expand Up @@ -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");
}
}

0 comments on commit ada7fb6

Please sign in to comment.