-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add
polars_err!(col_not_found=
shortcut
- Loading branch information
1 parent
2e77d31
commit d7ceee5
Showing
4 changed files
with
17 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
use crate::array::{Array, ArrayRef, UInt32Array, Utf8ViewArray}; | ||
use crate::buffer::Buffer; | ||
use crate::datatypes::ArrowDataType; | ||
use crate::legacy::trusted_len::TrustedLenPush; | ||
|
||
pub fn utf8view_len_bytes(array: &Utf8ViewArray) -> ArrayRef { | ||
let values = array.len_iter().collect::<Vec<_>>(); | ||
let values: Buffer<_> = values.into(); | ||
let values: Buffer<_> = array.len_iter().collect(); | ||
let array = UInt32Array::new(ArrowDataType::UInt32, values, array.validity().cloned()); | ||
Box::new(array) | ||
} | ||
|
||
pub fn string_len_chars(array: &Utf8ViewArray) -> ArrayRef { | ||
let values = array.values_iter().map(|x| x.chars().count() as u32); | ||
let values: Buffer<_> = Vec::from_trusted_len_iter(values).into(); | ||
let values: Buffer<_> = array | ||
.values_iter() | ||
.map(|x| x.chars().count() as u32) | ||
.collect(); | ||
let array = UInt32Array::new(ArrowDataType::UInt32, values, array.validity().cloned()); | ||
Box::new(array) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters