MCPcopy Create free account
hub / github.com/apache/arrow-rs / is_ascii

Method is_ascii

arrow-array/src/array/byte_view_array.rs:1144–1155  ·  view source on GitHub ↗

Returns true if all data within this array is ASCII

(&self)

Source from the content-addressed store, hash-verified

1142
1143 /// Returns true if all data within this array is ASCII
1144 pub fn is_ascii(&self) -> bool {
1145 // Alternative (but incorrect): directly check the underlying buffers
1146 // (1) Our string view might be sparse, i.e., a subset of the buffers,
1147 // so even if the buffer is not ascii, we can still be ascii.
1148 // (2) It is quite difficult to know the range of each buffer (unlike StringArray)
1149 // This means that this operation is quite expensive, shall we cache the result?
1150 // i.e. track `is_ascii` in the builder.
1151 self.iter().all(|v| match v {
1152 Some(v) => v.is_ascii(),
1153 None => true,
1154 })
1155 }
1156}
1157
1158impl From<Vec<&str>> for StringViewArray {

Callers

nothing calls this directly

Calls 2

allMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected