Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into count_distinct_grou…
Browse files Browse the repository at this point in the history
…ps_accumulator
  • Loading branch information
korowa committed Jan 2, 2024
2 parents 251fed2 + c1fe3dd commit 541fca8
Show file tree
Hide file tree
Showing 44 changed files with 1,041 additions and 911 deletions.
9 changes: 5 additions & 4 deletions datafusion/common/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,11 @@ pub fn coerced_type_with_base_type_only(

/// Compute the number of dimensions in a list data type.
pub fn list_ndims(data_type: &DataType) -> u64 {
if let DataType::List(field) = data_type {
1 + list_ndims(field.data_type())
} else {
0
match data_type {
DataType::List(field) | DataType::LargeList(field) => {
1 + list_ndims(field.data_type())
}
_ => 0,
}
}

Expand Down
6 changes: 4 additions & 2 deletions datafusion/core/src/dataframe/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,7 @@ mod tests {
use datafusion_expr::{
avg, cast, count, count_distinct, create_udf, expr, lit, max, min, sum,
BuiltInWindowFunction, ScalarFunctionImplementation, Volatility, WindowFrame,
WindowFunction,
WindowFunctionDefinition,
};
use datafusion_physical_expr::expressions::Column;
use datafusion_physical_plan::get_plan_string;
Expand Down Expand Up @@ -1525,7 +1525,9 @@ mod tests {
// build plan using Table API
let t = test_table().await?;
let first_row = Expr::WindowFunction(expr::WindowFunction::new(
WindowFunction::BuiltInWindowFunction(BuiltInWindowFunction::FirstValue),
WindowFunctionDefinition::BuiltInWindowFunction(
BuiltInWindowFunction::FirstValue,
),
vec![col("aggregate_test_100.c1")],
vec![col("aggregate_test_100.c2")],
vec![],
Expand Down
4 changes: 2 additions & 2 deletions datafusion/core/src/datasource/file_format/write/demux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ fn compute_take_arrays(

fn remove_partition_by_columns(
parted_batch: &RecordBatch,
partition_by: &Vec<(String, DataType)>,
partition_by: &[(String, DataType)],
) -> Result<RecordBatch> {
let end_idx = parted_batch.num_columns() - partition_by.len();
let non_part_cols = &parted_batch.columns()[..end_idx];
Expand All @@ -405,7 +405,7 @@ fn remove_partition_by_columns(
}

fn compute_hive_style_file_path(
part_key: &Vec<String>,
part_key: &[String],
partition_by: &[(String, DataType)],
write_id: &str,
file_extension: &str,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ fn prune_pages_in_one_row_group(
}

fn create_row_count_in_each_page(
location: &Vec<PageLocation>,
location: &[PageLocation],
num_rows: usize,
) -> Vec<usize> {
let mut vec = Vec::with_capacity(location.len());
Expand Down
Loading

0 comments on commit 541fca8

Please sign in to comment.