Skip to content

Commit 599dc31

Browse files
committed
Fix fmt
1 parent 80fe933 commit 599dc31

5 files changed

Lines changed: 11 additions & 9 deletions

File tree

datafusion/catalog/src/stream.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ impl TableProviderFactory for StreamTableFactory {
5555
) -> Result<Arc<dyn TableProvider>> {
5656
let location = match cmd.locations.len() {
5757
1 => &cmd.locations[0],
58-
_ => return config_err!("Stream table factory supports only a single table location"),
58+
_ => {
59+
return config_err!(
60+
"Stream table factory supports only a single table location"
61+
)
62+
}
5963
};
6064

6165
let schema: SchemaRef = Arc::clone(cmd.schema.inner());

datafusion/core/src/datasource/listing_table_factory.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ use std::collections::HashSet;
2626
use std::path::Path;
2727
use std::sync::Arc;
2828

29-
use arrow::datatypes::DataType;
30-
use datafusion_common::{arrow_datafusion_err, plan_err, DataFusionError, ToDFSchema};
3129
use arrow::datatypes::{DataType, SchemaRef};
3230
use datafusion_common::{config_datafusion_err, Result};
3331
use datafusion_common::{plan_err, DFSchema, DataFusionError, ToDFSchema};

datafusion/core/src/test_util/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ impl TableProviderFactory for TestTableFactory {
184184
cmd: &CreateExternalTable,
185185
) -> Result<Arc<dyn TableProvider>> {
186186
Ok(Arc::new(TestTableProvider {
187-
url: cmd.locations,
188-
schema: Arc::new(cmd.schema.as_ref().into()),
187+
url: cmd.locations.clone(),
188+
schema: Arc::clone(cmd.schema.inner()),
189189
}))
190190
}
191191
}

datafusion/proto/src/logical_plan/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ impl AsLogicalPlan for LogicalPlanNode {
625625
create_extern_table.name.as_ref(),
626626
"CreateExternalTable",
627627
)?,
628-
locations: create_extern_table.location.clone(),
628+
locations: vec![create_extern_table.location.clone()],
629629
file_type: create_extern_table.file_type.clone(),
630630
table_partition_cols: create_extern_table
631631
.table_partition_cols
@@ -1499,7 +1499,7 @@ impl AsLogicalPlan for LogicalPlanNode {
14991499
logical_plan_type: Some(LogicalPlanType::CreateExternalTable(
15001500
protobuf::CreateExternalTableNode {
15011501
name: Some(name.clone().into()),
1502-
location: location.clone(),
1502+
location: location.clone().join(","),
15031503
file_type: file_type.clone(),
15041504
schema: Some(df_schema.try_into()?),
15051505
table_partition_cols: table_partition_cols.clone(),

datafusion/proto/tests/cases/roundtrip_logical_plan.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ impl LogicalExtensionCodec for TestTableProviderCodec {
196196
})?;
197197
assert_eq!(msg.table_name, table_ref.to_string());
198198
let provider = TestTableProvider {
199-
url: msg.url,
199+
url: vec![msg.url],
200200
schema,
201201
};
202202
Ok(Arc::new(provider))
@@ -214,7 +214,7 @@ impl LogicalExtensionCodec for TestTableProviderCodec {
214214
.downcast_ref::<TestTableProvider>()
215215
.expect("Can't encode non-test tables");
216216
let msg = TestTableProto {
217-
url: table.url.clone(),
217+
url: table.url.join(","),
218218
table_name: table_ref.to_string(),
219219
};
220220
msg.encode(buf).map_err(|_| {

0 commit comments

Comments
 (0)