Skip to content

Commit

Permalink
fix compile.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachelint committed Oct 22, 2024
1 parent ebbeb5a commit dad79c0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
21 changes: 9 additions & 12 deletions datafusion/physical-plan/src/aggregates/group_values/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.

use std::mem;

use crate::aggregates::group_values::group_column::{
ByteGroupValueBuilder, ByteViewGroupValueBuilder, GroupColumn,
PrimitiveGroupValueBuilder,
Expand Down Expand Up @@ -246,14 +248,6 @@ impl GroupValuesColumn {
)
}

#[inline]
fn get_group_indices_from_list(
&self,
start_group_index: usize,
) -> GroupIndicesIterator {
GroupIndicesIterator::new(start_group_index, &self.group_index_lists)
}

/// Collect vectorized context by checking hash values of `cols` in `map`
///
/// 1. If bucket not found
Expand Down Expand Up @@ -328,7 +322,7 @@ impl GroupValuesColumn {
}

fn vectorized_compare(&mut self) {

}
}

Expand Down Expand Up @@ -412,10 +406,10 @@ impl GroupValues for GroupValuesColumn {
// tracks to which group each of the input rows belongs
groups.clear();

let batch_hashes = &mut self.hashes_buffer;
let mut batch_hashes = mem::take(&mut self.hashes_buffer);
batch_hashes.clear();
batch_hashes.resize(n_rows, 0);
create_hashes(cols, &self.random_state, batch_hashes)?;
create_hashes(cols, &self.random_state, &mut batch_hashes)?;

// General steps for one round `vectorized compare & append`:
// 1. Collect vectorized context by checking hash values of `cols` in `map`
Expand All @@ -433,10 +427,13 @@ impl GroupValues for GroupValuesColumn {
self.vectorized_compare_results.clear();

// 1. Collect vectorized context by checking hash values of `cols` in `map`
self.collect_vectorized_process_context(batch_hashes);
self.collect_vectorized_process_context(&batch_hashes);

// 2. Perform `vectorized compare`
}

self.hashes_buffer = batch_hashes;

Ok(())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -617,14 +617,14 @@ impl<B: ByteViewType> ByteViewGroupValueBuilder<B> {
if all_non_null {
self.nulls.append_n(rows.len(), false);
for &row in rows {
self.append_value(arr, row);
self.do_append_val_inner(arr, row);
}
} else {
for &row in rows {
// Null row case, set and return
if arr.is_valid(row) {
self.nulls.append(false);
self.append_value(arr, row);
self.do_append_val_inner(arr, row);
} else {
self.nulls.append(true);
self.views.push(0);
Expand All @@ -645,10 +645,10 @@ impl<B: ByteViewType> ByteViewGroupValueBuilder<B> {

// Not null row case
self.nulls.append(false);
self.append_value(arr, row);
self.do_append_val_inner(arr, row);
}

fn append_value(&mut self, array: &GenericByteViewArray<B>, row: usize)
fn do_append_val_inner(&mut self, array: &GenericByteViewArray<B>, row: usize)
where
B: ByteViewType,
{
Expand Down Expand Up @@ -690,7 +690,15 @@ impl<B: ByteViewType> ByteViewGroupValueBuilder<B> {

fn equal_to_inner(&self, lhs_row: usize, array: &ArrayRef, rhs_row: usize) -> bool {
let array = array.as_byte_view::<B>();
self.do_equal_to_inner(lhs_row, array, rhs_row)
}

fn do_equal_to_inner(
&self,
lhs_row: usize,
array: &GenericByteViewArray<B>,
rhs_row: usize,
) -> bool {
// Check if nulls equal firstly
let exist_null = self.nulls.is_null(lhs_row);
let input_null = array.is_null(rhs_row);
Expand Down

0 comments on commit dad79c0

Please sign in to comment.