Skip to content

Commit

Permalink
move NullState
Browse files Browse the repository at this point in the history
Signed-off-by: jayzhan211 <[email protected]>
  • Loading branch information
jayzhan211 committed May 19, 2024
1 parent 0338865 commit 0765730
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 6 deletions.
1 change: 1 addition & 0 deletions datafusion-cli/Cargo.lock

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

1 change: 1 addition & 0 deletions datafusion/physical-expr-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ path = "src/lib.rs"
arrow = { workspace = true }
datafusion-common = { workspace = true, default-features = true }
datafusion-expr = { workspace = true }
rand = { workspace = true }
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
//!
//! [`GroupsAccumulator`]: datafusion_expr::GroupsAccumulator

use arrow::array::{Array, BooleanArray, BooleanBufferBuilder, PrimitiveArray};
use arrow::buffer::{BooleanBuffer, NullBuffer};
use arrow::datatypes::ArrowPrimitiveType;
use arrow_array::{Array, BooleanArray, PrimitiveArray};
use arrow_buffer::{BooleanBuffer, BooleanBufferBuilder, NullBuffer};

use datafusion_expr::EmitTo;
/// Track the accumulator null state per row: if any values for that
Expand Down Expand Up @@ -462,9 +462,9 @@ fn initialize_builder(
mod test {
use super::*;

use arrow_array::UInt32Array;
use hashbrown::HashSet;
use arrow::array::UInt32Array;
use rand::{rngs::ThreadRng, Rng};
use std::collections::HashSet;

#[test]
fn accumulate() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

pub mod accumulate;
1 change: 1 addition & 0 deletions datafusion/physical-expr-common/src/aggregate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// specific language governing permissions and limitations
// under the License.

pub mod groups_accumulator;
pub mod stats;
pub mod utils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@
// specific language governing permissions and limitations
// under the License.

pub(crate) mod accumulate;
mod adapter;
pub use accumulate::NullState;

pub(crate) mod accumulate {
pub use datafusion_physical_expr_common::aggregate::groups_accumulator::accumulate::{accumulate_indices, NullState};
}

pub use adapter::GroupsAccumulatorAdapter;
pub use datafusion_physical_expr_common::aggregate::groups_accumulator::accumulate::NullState;

pub(crate) mod bool_op;
pub(crate) mod prim_op;

0 comments on commit 0765730

Please sign in to comment.