Skip to content

Commit

Permalink
Merge branch 'main' into 12118/substrait-serialize-views
Browse files Browse the repository at this point in the history
  • Loading branch information
wiedld committed Sep 6, 2024
2 parents 831017c + 9d819e1 commit c587f99
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 26 deletions.
20 changes: 9 additions & 11 deletions datafusion/core/src/execution/session_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1035,17 +1035,15 @@ impl SessionStateBuilder {
}
}

/// Set defaults for table_factories, file formats, expr_planners and builtin
/// scalar and aggregate functions.
pub fn with_default_features(mut self) -> Self {
self.table_factories = Some(SessionStateDefaults::default_table_factories());
self.file_formats = Some(SessionStateDefaults::default_file_formats());
self.expr_planners = Some(SessionStateDefaults::default_expr_planners());
self.scalar_functions = Some(SessionStateDefaults::default_scalar_functions());
self.aggregate_functions =
Some(SessionStateDefaults::default_aggregate_functions());
self.window_functions = Some(SessionStateDefaults::default_window_functions());
self
/// Create default builder with defaults for table_factories, file formats, expr_planners and builtin
/// scalar, aggregate and windows functions.
pub fn with_default_features(self) -> Self {
self.with_table_factories(SessionStateDefaults::default_table_factories())
.with_file_formats(SessionStateDefaults::default_file_formats())
.with_expr_planners(SessionStateDefaults::default_expr_planners())
.with_scalar_functions(SessionStateDefaults::default_scalar_functions())
.with_aggregate_functions(SessionStateDefaults::default_aggregate_functions())
.with_window_functions(SessionStateDefaults::default_window_functions())
}

/// Set the session id.
Expand Down
12 changes: 6 additions & 6 deletions datafusion/functions/benches/repeat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fn criterion_benchmark(c: &mut Criterion) {

let args = create_args::<i32>(size, 32, repeat_times, true);
group.bench_function(
&format!(
format!(
"repeat_string_view [size={}, repeat_times={}]",
size, repeat_times
),
Expand All @@ -76,7 +76,7 @@ fn criterion_benchmark(c: &mut Criterion) {

let args = create_args::<i32>(size, 32, repeat_times, false);
group.bench_function(
&format!(
format!(
"repeat_string [size={}, repeat_times={}]",
size, repeat_times
),
Expand All @@ -85,7 +85,7 @@ fn criterion_benchmark(c: &mut Criterion) {

let args = create_args::<i64>(size, 32, repeat_times, false);
group.bench_function(
&format!(
format!(
"repeat_large_string [size={}, repeat_times={}]",
size, repeat_times
),
Expand All @@ -103,7 +103,7 @@ fn criterion_benchmark(c: &mut Criterion) {

let args = create_args::<i32>(size, 32, repeat_times, true);
group.bench_function(
&format!(
format!(
"repeat_string_view [size={}, repeat_times={}]",
size, repeat_times
),
Expand All @@ -112,7 +112,7 @@ fn criterion_benchmark(c: &mut Criterion) {

let args = create_args::<i32>(size, 32, repeat_times, false);
group.bench_function(
&format!(
format!(
"repeat_string [size={}, repeat_times={}]",
size, repeat_times
),
Expand All @@ -121,7 +121,7 @@ fn criterion_benchmark(c: &mut Criterion) {

let args = create_args::<i64>(size, 32, repeat_times, false);
group.bench_function(
&format!(
format!(
"repeat_large_string [size={}, repeat_times={}]",
size, repeat_times
),
Expand Down
18 changes: 9 additions & 9 deletions datafusion/functions/benches/substr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,19 @@ fn criterion_benchmark(c: &mut Criterion) {

let args = create_args_without_count::<i32>(size, len, true, true);
group.bench_function(
&format!("substr_string_view [size={}, strlen={}]", size, len),
format!("substr_string_view [size={}, strlen={}]", size, len),
|b| b.iter(|| black_box(substr.invoke(&args))),
);

let args = create_args_without_count::<i32>(size, len, false, false);
group.bench_function(
&format!("substr_string [size={}, strlen={}]", size, len),
format!("substr_string [size={}, strlen={}]", size, len),
|b| b.iter(|| black_box(substr.invoke(&args))),
);

let args = create_args_without_count::<i64>(size, len, true, false);
group.bench_function(
&format!("substr_large_string [size={}, strlen={}]", size, len),
format!("substr_large_string [size={}, strlen={}]", size, len),
|b| b.iter(|| black_box(substr.invoke(&args))),
);

Expand All @@ -133,7 +133,7 @@ fn criterion_benchmark(c: &mut Criterion) {

let args = create_args_with_count::<i32>(size, len, count, true);
group.bench_function(
&format!(
format!(
"substr_string_view [size={}, count={}, strlen={}]",
size, count, len,
),
Expand All @@ -142,7 +142,7 @@ fn criterion_benchmark(c: &mut Criterion) {

let args = create_args_with_count::<i32>(size, len, count, false);
group.bench_function(
&format!(
format!(
"substr_string [size={}, count={}, strlen={}]",
size, count, len,
),
Expand All @@ -151,7 +151,7 @@ fn criterion_benchmark(c: &mut Criterion) {

let args = create_args_with_count::<i64>(size, len, count, false);
group.bench_function(
&format!(
format!(
"substr_large_string [size={}, count={}, strlen={}]",
size, count, len,
),
Expand All @@ -169,7 +169,7 @@ fn criterion_benchmark(c: &mut Criterion) {

let args = create_args_with_count::<i32>(size, len, count, true);
group.bench_function(
&format!(
format!(
"substr_string_view [size={}, count={}, strlen={}]",
size, count, len,
),
Expand All @@ -178,7 +178,7 @@ fn criterion_benchmark(c: &mut Criterion) {

let args = create_args_with_count::<i32>(size, len, count, false);
group.bench_function(
&format!(
format!(
"substr_string [size={}, count={}, strlen={}]",
size, count, len,
),
Expand All @@ -187,7 +187,7 @@ fn criterion_benchmark(c: &mut Criterion) {

let args = create_args_with_count::<i64>(size, len, count, false);
group.bench_function(
&format!(
format!(
"substr_large_string [size={}, count={}, strlen={}]",
size, count, len,
),
Expand Down

0 comments on commit c587f99

Please sign in to comment.