Skip to content

Commit

Permalink
Use a comparable row format.
Browse files Browse the repository at this point in the history
  • Loading branch information
RinChanNOWWW committed Nov 1, 2022
1 parent 866f2dc commit 97701e8
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 152 deletions.
7 changes: 4 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/common/arrow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ simd = ["arrow/simd"]
# Workspace dependencies

# Crates.io dependencies
arrow = { package = "arrow2", version = "0.14.0", default-features = false, features = [
arrow = { package = "arrow2", git = "https://github.com/RinChanNOWWW/arrow2", rev = "78c61d5", default-features = false, features = [
"io_parquet",
"io_parquet_compression",
] }
Expand Down
20 changes: 0 additions & 20 deletions src/query/datablocks/src/kernels/data_block_sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,28 +205,8 @@ impl DataBlock {
}
}
}

pub fn build_compare(
left: &DataBlock,
right: &DataBlock,
sort_column_descriptions: &[SortColumnDescription],
) -> Result<ColumnsDynComparator> {
let mut res = Vec::with_capacity(sort_column_descriptions.len());
for SortColumnDescription { column_name, .. } in sort_column_descriptions {
let l = left.try_column_by_name(column_name)?;
let l = l.as_arrow_array(l.data_type());

let r = right.try_column_by_name(column_name)?;
let r = r.as_arrow_array(r.data_type());
let cmp = build_compare(&*l, &*r)?;
res.push(cmp);
}
Ok(res)
}
}

pub type ColumnsDynComparator = Vec<DynComparator>;

fn compare_variant(left: &dyn Array, right: &dyn Array) -> ArrowResult<DynComparator> {
let left = VariantColumn::from_arrow_array(left);
let right = VariantColumn::from_arrow_array(right);
Expand Down
1 change: 0 additions & 1 deletion src/query/datablocks/src/kernels/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ mod data_block_sort;
mod data_block_take;

pub use data_block_group_by_hash::*;
pub use data_block_sort::ColumnsDynComparator;
pub use data_block_sort::SortColumnDescription;
3 changes: 2 additions & 1 deletion src/query/pipeline/transforms/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ doctest = false
test = false

[dependencies]
common-catalog = { path = "../../catalog" }
common-arrow = { path = "../../../common/arrow" }
common-datablocks = { path = "../../datablocks" }
common-datavalues = { path = "../../datavalues" }
common-exception = { path = "../../../common/exception" }
common-pipeline-core = { path = "../core" }

Expand Down

0 comments on commit 97701e8

Please sign in to comment.