Skip to content

chore(query): remove SliceExt #16853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/common/base/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ pub mod http_client;
pub mod mem_allocator;
pub mod rangemap;
pub mod runtime;
pub mod slice_ext;
pub mod vec_ext;
pub mod version;

Expand Down
62 changes: 0 additions & 62 deletions src/common/base/src/slice_ext.rs

This file was deleted.

3 changes: 1 addition & 2 deletions src/query/expression/src/kernels/take.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use databend_common_arrow::arrow::array::Array;
use databend_common_arrow::arrow::array::Utf8ViewArray;
use databend_common_arrow::arrow::bitmap::Bitmap;
use databend_common_arrow::arrow::buffer::Buffer;
use databend_common_base::slice_ext::GetSaferUnchecked;
use databend_common_exception::Result;
use string::StringColumnBuilder;

Expand Down Expand Up @@ -258,7 +257,7 @@ where I: databend_common_arrow::arrow::types::Index
let result: Vec<T> = self
.indices
.iter()
.map(|index| unsafe { *col.get_unchecked_release(index.to_usize()) })
.map(|index| unsafe { *col.get_unchecked(index.to_usize()) })
.collect();
result.into()
}
Expand Down
7 changes: 3 additions & 4 deletions src/query/expression/src/types/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ use std::ops::Range;
use databend_common_arrow::arrow::array::MutableBinaryViewArray;
use databend_common_arrow::arrow::array::Utf8ViewArray;
use databend_common_arrow::arrow::trusted_len::TrustedLen;
use databend_common_base::slice_ext::GetSaferUnchecked;
use databend_common_exception::ErrorCode;
use databend_common_exception::Result;

Expand Down Expand Up @@ -293,8 +292,8 @@ impl StringColumn {
}

pub fn compare(col_i: &Self, i: usize, col_j: &Self, j: usize) -> Ordering {
let view_i = unsafe { col_i.data.views().as_slice().get_unchecked_release(i) };
let view_j = unsafe { col_j.data.views().as_slice().get_unchecked_release(j) };
let view_i = unsafe { col_i.data.views().as_slice().get_unchecked(i) };
let view_j = unsafe { col_j.data.views().as_slice().get_unchecked(j) };

if view_i.prefix == view_j.prefix {
unsafe {
Expand All @@ -311,7 +310,7 @@ impl StringColumn {
}

pub fn compare_str(col: &Self, i: usize, value: &str) -> Ordering {
let view = unsafe { col.data.views().as_slice().get_unchecked_release(i) };
let view = unsafe { col.data.views().as_slice().get_unchecked(i) };
let prefix = load_prefix(value.as_bytes());

if view.prefix == prefix {
Expand Down
Loading