Skip to content

Commit d0ab1fb

Browse files
committed
cargo_fmt_rebase_main
1 parent 349b624 commit d0ab1fb

26 files changed

Lines changed: 320 additions & 320 deletions

datafusion/ffi/src/catalog_provider.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ use datafusion_common::error::Result;
2424
use datafusion_proto::logical_plan::{
2525
DefaultLogicalExtensionCodec, LogicalExtensionCodec,
2626
};
27-
use stabby::string::String as StabbyString;
28-
use stabby::vec::Vec as StabbyVec;
27+
use stabby::string::String as SString;
28+
use stabby::vec::Vec as SVec;
2929
use tokio::runtime::Handle;
3030

3131
use crate::execution::FFI_TaskContextProvider;
@@ -38,24 +38,24 @@ use crate::{df_result, rresult_return};
3838
#[repr(C)]
3939
#[derive(Debug)]
4040
pub struct FFI_CatalogProvider {
41-
pub schema_names: unsafe extern "C" fn(provider: &Self) -> StabbyVec<StabbyString>,
41+
pub schema_names: unsafe extern "C" fn(provider: &Self) -> SVec<SString>,
4242

4343
pub schema: unsafe extern "C" fn(
4444
provider: &Self,
45-
name: StabbyString,
45+
name: SString,
4646
) -> FfiOption<FFI_SchemaProvider>,
4747

4848
pub register_schema: unsafe extern "C" fn(
4949
provider: &Self,
50-
name: StabbyString,
50+
name: SString,
5151
schema: &FFI_SchemaProvider,
5252
)
5353
-> FFIResult<FfiOption<FFI_SchemaProvider>>,
5454

5555
pub deregister_schema:
5656
unsafe extern "C" fn(
5757
provider: &Self,
58-
name: StabbyString,
58+
name: SString,
5959
cascade: bool,
6060
) -> FFIResult<FfiOption<FFI_SchemaProvider>>,
6161

@@ -107,7 +107,7 @@ impl FFI_CatalogProvider {
107107

108108
unsafe extern "C" fn schema_names_fn_wrapper(
109109
provider: &FFI_CatalogProvider,
110-
) -> StabbyVec<StabbyString> {
110+
) -> SVec<SString> {
111111
unsafe {
112112
let names = provider.inner().schema_names();
113113
names.into_iter().map(|s| s.into()).collect()
@@ -116,7 +116,7 @@ unsafe extern "C" fn schema_names_fn_wrapper(
116116

117117
unsafe extern "C" fn schema_fn_wrapper(
118118
provider: &FFI_CatalogProvider,
119-
name: StabbyString,
119+
name: SString,
120120
) -> FfiOption<FFI_SchemaProvider> {
121121
unsafe {
122122
let maybe_schema = provider.inner().schema(name.as_str());
@@ -134,7 +134,7 @@ unsafe extern "C" fn schema_fn_wrapper(
134134

135135
unsafe extern "C" fn register_schema_fn_wrapper(
136136
provider: &FFI_CatalogProvider,
137-
name: StabbyString,
137+
name: SString,
138138
schema: &FFI_SchemaProvider,
139139
) -> FFIResult<FfiOption<FFI_SchemaProvider>> {
140140
unsafe {
@@ -159,7 +159,7 @@ unsafe extern "C" fn register_schema_fn_wrapper(
159159

160160
unsafe extern "C" fn deregister_schema_fn_wrapper(
161161
provider: &FFI_CatalogProvider,
162-
name: StabbyString,
162+
name: SString,
163163
cascade: bool,
164164
) -> FFIResult<FfiOption<FFI_SchemaProvider>> {
165165
unsafe {

datafusion/ffi/src/catalog_provider_list.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ use datafusion_catalog::{CatalogProvider, CatalogProviderList};
2323
use datafusion_proto::logical_plan::{
2424
DefaultLogicalExtensionCodec, LogicalExtensionCodec,
2525
};
26-
use stabby::string::String as StabbyString;
27-
use stabby::vec::Vec as StabbyVec;
26+
use stabby::string::String as SString;
27+
use stabby::vec::Vec as SVec;
2828
use tokio::runtime::Handle;
2929

3030
use crate::catalog_provider::{FFI_CatalogProvider, ForeignCatalogProvider};
@@ -39,16 +39,16 @@ pub struct FFI_CatalogProviderList {
3939
/// Register a catalog
4040
pub register_catalog: unsafe extern "C" fn(
4141
&Self,
42-
name: StabbyString,
42+
name: SString,
4343
catalog: &FFI_CatalogProvider,
4444
) -> FfiOption<FFI_CatalogProvider>,
4545

4646
/// List of existing catalogs
47-
pub catalog_names: unsafe extern "C" fn(&Self) -> StabbyVec<StabbyString>,
47+
pub catalog_names: unsafe extern "C" fn(&Self) -> SVec<SString>,
4848

4949
/// Access a catalog
5050
pub catalog:
51-
unsafe extern "C" fn(&Self, name: StabbyString) -> FfiOption<FFI_CatalogProvider>,
51+
unsafe extern "C" fn(&Self, name: SString) -> FfiOption<FFI_CatalogProvider>,
5252

5353
pub logical_codec: FFI_LogicalExtensionCodec,
5454

@@ -98,7 +98,7 @@ impl FFI_CatalogProviderList {
9898

9999
unsafe extern "C" fn catalog_names_fn_wrapper(
100100
provider: &FFI_CatalogProviderList,
101-
) -> StabbyVec<StabbyString> {
101+
) -> SVec<SString> {
102102
unsafe {
103103
let names = provider.inner().catalog_names();
104104
names.into_iter().map(|s| s.into()).collect()
@@ -107,7 +107,7 @@ unsafe extern "C" fn catalog_names_fn_wrapper(
107107

108108
unsafe extern "C" fn register_catalog_fn_wrapper(
109109
provider: &FFI_CatalogProviderList,
110-
name: StabbyString,
110+
name: SString,
111111
catalog: &FFI_CatalogProvider,
112112
) -> FfiOption<FFI_CatalogProvider> {
113113
unsafe {
@@ -130,7 +130,7 @@ unsafe extern "C" fn register_catalog_fn_wrapper(
130130

131131
unsafe extern "C" fn catalog_fn_wrapper(
132132
provider: &FFI_CatalogProviderList,
133-
name: StabbyString,
133+
name: SString,
134134
) -> FfiOption<FFI_CatalogProvider> {
135135
unsafe {
136136
let runtime = provider.runtime();

datafusion/ffi/src/config/extension_options.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ use std::ffi::c_void;
2222
use datafusion_common::config::{ConfigEntry, ConfigExtension, ExtensionOptions};
2323
use datafusion_common::{Result, exec_err};
2424

25-
use stabby::str::Str as StabbyStr;
26-
use stabby::string::String as StabbyString;
27-
use stabby::vec::Vec as StabbyVec;
25+
use stabby::str::Str as SStr;
26+
use stabby::string::String as SString;
27+
use stabby::vec::Vec as SVec;
2828

2929
use crate::df_result;
3030
use crate::util::{FFIResult, FfiResult};
@@ -49,12 +49,12 @@ pub struct FFI_ExtensionOptions {
4949
/// Set the given `key`, `value` pair
5050
pub set: unsafe extern "C" fn(
5151
&mut Self,
52-
key: StabbyStr,
53-
value: StabbyStr,
52+
key: SStr,
53+
value: SStr,
5454
) -> FFIResult<()>,
5555

5656
/// Returns the [`ConfigEntry`] stored in this [`ExtensionOptions`]
57-
pub entries: unsafe extern "C" fn(&Self) -> StabbyVec<(StabbyString, StabbyString)>,
57+
pub entries: unsafe extern "C" fn(&Self) -> SVec<(SString, SString)>,
5858

5959
/// Release the memory of the private data when it is no longer being used.
6060
pub release: unsafe extern "C" fn(&mut Self),
@@ -97,8 +97,8 @@ unsafe extern "C" fn cloned_fn_wrapper(
9797

9898
unsafe extern "C" fn set_fn_wrapper(
9999
options: &mut FFI_ExtensionOptions,
100-
key: StabbyStr,
101-
value: StabbyStr,
100+
key: SStr,
101+
value: SStr,
102102
) -> FFIResult<()> {
103103
let _ = options
104104
.inner_mut()
@@ -108,7 +108,7 @@ unsafe extern "C" fn set_fn_wrapper(
108108

109109
unsafe extern "C" fn entries_fn_wrapper(
110110
options: &FFI_ExtensionOptions,
111-
) -> StabbyVec<(StabbyString, StabbyString)> {
111+
) -> SVec<(SString, SString)> {
112112
options
113113
.inner()
114114
.iter()

datafusion/ffi/src/config/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ use datafusion_common::config::{
2121
ConfigExtension, ConfigOptions, ExtensionOptions, TableOptions,
2222
};
2323
use datafusion_common::{DataFusionError, Result};
24-
use stabby::string::String as StabbyString;
25-
use stabby::vec::Vec as StabbyVec;
24+
use stabby::string::String as SString;
25+
use stabby::vec::Vec as SVec;
2626

2727
use crate::config::extension_options::FFI_ExtensionOptions;
2828

@@ -34,14 +34,14 @@ use crate::config::extension_options::FFI_ExtensionOptions;
3434
#[repr(C)]
3535
#[derive(Debug, Clone)]
3636
pub struct FFI_ConfigOptions {
37-
base_options: StabbyVec<(StabbyString, StabbyString)>,
37+
base_options: SVec<(SString, SString)>,
3838

3939
extensions: FFI_ExtensionOptions,
4040
}
4141

4242
impl From<&ConfigOptions> for FFI_ConfigOptions {
4343
fn from(options: &ConfigOptions) -> Self {
44-
let base_options: StabbyVec<(StabbyString, StabbyString)> = options
44+
let base_options: SVec<(SString, SString)> = options
4545
.entries()
4646
.into_iter()
4747
.filter_map(|entry| entry.value.map(|value| (entry.key, value)))
@@ -122,14 +122,14 @@ impl ExtensionOptionsFFIProvider for TableOptions {
122122
#[repr(C)]
123123
#[derive(Debug, Clone)]
124124
pub struct FFI_TableOptions {
125-
base_options: StabbyVec<(StabbyString, StabbyString)>,
125+
base_options: SVec<(SString, SString)>,
126126

127127
extensions: FFI_ExtensionOptions,
128128
}
129129

130130
impl From<&TableOptions> for FFI_TableOptions {
131131
fn from(options: &TableOptions) -> Self {
132-
let base_options: StabbyVec<(StabbyString, StabbyString)> = options
132+
let base_options: SVec<(SString, SString)> = options
133133
.entries()
134134
.into_iter()
135135
.filter_map(|entry| entry.value.map(|value| (entry.key, value)))

datafusion/ffi/src/execution/task_ctx.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ use datafusion_expr::{
2525
AggregateUDF, AggregateUDFImpl, ScalarUDF, ScalarUDFImpl, WindowUDF, WindowUDFImpl,
2626
};
2727

28-
use stabby::string::String as StabbyString;
29-
use stabby::vec::Vec as StabbyVec;
28+
use stabby::string::String as SString;
29+
use stabby::vec::Vec as SVec;
3030

3131
use crate::session::config::FFI_SessionConfig;
3232
use crate::udaf::FFI_AggregateUDF;
@@ -39,25 +39,25 @@ use crate::util::FfiOption;
3939
#[derive(Debug)]
4040
pub struct FFI_TaskContext {
4141
/// Return the session ID.
42-
pub session_id: unsafe extern "C" fn(&Self) -> StabbyString,
42+
pub session_id: unsafe extern "C" fn(&Self) -> SString,
4343

4444
/// Return the task ID.
45-
pub task_id: unsafe extern "C" fn(&Self) -> FfiOption<StabbyString>,
45+
pub task_id: unsafe extern "C" fn(&Self) -> FfiOption<SString>,
4646

4747
/// Return the session configuration.
4848
pub session_config: unsafe extern "C" fn(&Self) -> FFI_SessionConfig,
4949

5050
/// Returns a vec of name-function pairs for scalar functions.
5151
pub scalar_functions:
52-
unsafe extern "C" fn(&Self) -> StabbyVec<(StabbyString, FFI_ScalarUDF)>,
52+
unsafe extern "C" fn(&Self) -> SVec<(SString, FFI_ScalarUDF)>,
5353

5454
/// Returns a vec of name-function pairs for aggregate functions.
5555
pub aggregate_functions:
56-
unsafe extern "C" fn(&Self) -> StabbyVec<(StabbyString, FFI_AggregateUDF)>,
56+
unsafe extern "C" fn(&Self) -> SVec<(SString, FFI_AggregateUDF)>,
5757

5858
/// Returns a vec of name-function pairs for window functions.
5959
pub window_functions:
60-
unsafe extern "C" fn(&Self) -> StabbyVec<(StabbyString, FFI_WindowUDF)>,
60+
unsafe extern "C" fn(&Self) -> SVec<(SString, FFI_WindowUDF)>,
6161

6262
/// Release the memory of the private data when it is no longer being used.
6363
pub release: unsafe extern "C" fn(arg: &mut Self),
@@ -85,7 +85,7 @@ impl FFI_TaskContext {
8585
}
8686
}
8787

88-
unsafe extern "C" fn session_id_fn_wrapper(ctx: &FFI_TaskContext) -> StabbyString {
88+
unsafe extern "C" fn session_id_fn_wrapper(ctx: &FFI_TaskContext) -> SString {
8989
unsafe {
9090
let ctx = ctx.inner();
9191
ctx.session_id().into()
@@ -94,7 +94,7 @@ unsafe extern "C" fn session_id_fn_wrapper(ctx: &FFI_TaskContext) -> StabbyStrin
9494

9595
unsafe extern "C" fn task_id_fn_wrapper(
9696
ctx: &FFI_TaskContext,
97-
) -> FfiOption<StabbyString> {
97+
) -> FfiOption<SString> {
9898
unsafe {
9999
let ctx = ctx.inner();
100100
ctx.task_id().map(|s| s.as_str().into()).into()
@@ -112,7 +112,7 @@ unsafe extern "C" fn session_config_fn_wrapper(
112112

113113
unsafe extern "C" fn scalar_functions_fn_wrapper(
114114
ctx: &FFI_TaskContext,
115-
) -> StabbyVec<(StabbyString, FFI_ScalarUDF)> {
115+
) -> SVec<(SString, FFI_ScalarUDF)> {
116116
unsafe {
117117
let ctx = ctx.inner();
118118
ctx.scalar_functions()
@@ -124,7 +124,7 @@ unsafe extern "C" fn scalar_functions_fn_wrapper(
124124

125125
unsafe extern "C" fn aggregate_functions_fn_wrapper(
126126
ctx: &FFI_TaskContext,
127-
) -> StabbyVec<(StabbyString, FFI_AggregateUDF)> {
127+
) -> SVec<(SString, FFI_AggregateUDF)> {
128128
unsafe {
129129
let ctx = ctx.inner();
130130
ctx.aggregate_functions()
@@ -141,7 +141,7 @@ unsafe extern "C" fn aggregate_functions_fn_wrapper(
141141

142142
unsafe extern "C" fn window_functions_fn_wrapper(
143143
ctx: &FFI_TaskContext,
144-
) -> StabbyVec<(StabbyString, FFI_WindowUDF)> {
144+
) -> SVec<(SString, FFI_WindowUDF)> {
145145
unsafe {
146146
let ctx = ctx.inner();
147147
ctx.window_functions()

datafusion/ffi/src/execution_plan.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ use datafusion_execution::{SendableRecordBatchStream, TaskContext};
2626
use datafusion_physical_plan::{
2727
DisplayAs, DisplayFormatType, ExecutionPlan, PlanProperties,
2828
};
29-
use stabby::string::String as StabbyString;
30-
use stabby::vec::Vec as StabbyVec;
29+
use stabby::string::String as SString;
30+
use stabby::vec::Vec as SVec;
3131
use tokio::runtime::Handle;
3232

3333
use crate::config::FFI_ConfigOptions;
@@ -45,13 +45,13 @@ pub struct FFI_ExecutionPlan {
4545
pub properties: unsafe extern "C" fn(plan: &Self) -> FFI_PlanProperties,
4646

4747
/// Return a vector of children plans
48-
pub children: unsafe extern "C" fn(plan: &Self) -> StabbyVec<FFI_ExecutionPlan>,
48+
pub children: unsafe extern "C" fn(plan: &Self) -> SVec<FFI_ExecutionPlan>,
4949

5050
pub with_new_children:
51-
unsafe extern "C" fn(plan: &Self, children: StabbyVec<Self>) -> FFIResult<Self>,
51+
unsafe extern "C" fn(plan: &Self, children: SVec<Self>) -> FFIResult<Self>,
5252

5353
/// Return the plan name.
54-
pub name: unsafe extern "C" fn(plan: &Self) -> StabbyString,
54+
pub name: unsafe extern "C" fn(plan: &Self) -> SString,
5555

5656
/// Execute the plan and return a record batch stream. Errors
5757
/// will be returned as a string.
@@ -113,7 +113,7 @@ unsafe extern "C" fn properties_fn_wrapper(
113113

114114
unsafe extern "C" fn children_fn_wrapper(
115115
plan: &FFI_ExecutionPlan,
116-
) -> StabbyVec<FFI_ExecutionPlan> {
116+
) -> SVec<FFI_ExecutionPlan> {
117117
unsafe {
118118
let private_data = plan.private_data as *const ExecutionPlanPrivateData;
119119
let plan = &(*private_data).plan;
@@ -128,7 +128,7 @@ unsafe extern "C" fn children_fn_wrapper(
128128

129129
unsafe extern "C" fn with_new_children_fn_wrapper(
130130
plan: &FFI_ExecutionPlan,
131-
children: StabbyVec<FFI_ExecutionPlan>,
131+
children: SVec<FFI_ExecutionPlan>,
132132
) -> FFIResult<FFI_ExecutionPlan> {
133133
let runtime = plan.runtime();
134134
let inner_plan = Arc::clone(plan.inner());
@@ -179,7 +179,7 @@ unsafe extern "C" fn repartitioned_fn_wrapper(
179179
)
180180
}
181181

182-
unsafe extern "C" fn name_fn_wrapper(plan: &FFI_ExecutionPlan) -> StabbyString {
182+
unsafe extern "C" fn name_fn_wrapper(plan: &FFI_ExecutionPlan) -> SString {
183183
plan.inner().name().into()
184184
}
185185

@@ -389,7 +389,7 @@ impl ExecutionPlan for ForeignExecutionPlan {
389389
let children = children
390390
.into_iter()
391391
.map(|child| FFI_ExecutionPlan::new(child, None))
392-
.collect::<StabbyVec<_>>();
392+
.collect::<SVec<_>>();
393393
let new_plan =
394394
unsafe { df_result!((self.plan.with_new_children)(&self.plan, children))? };
395395

0 commit comments

Comments
 (0)