Skip to content

Commit f7887a9

Browse files
committed
cargo fmt
1 parent 8dbaca9 commit f7887a9

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

examples/sqlite.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
1-
use std::sync::Arc;
2-
use std::time::Duration;
31
use datafusion::{prelude::SessionContext, sql::TableReference};
42
use datafusion_table_providers::{
53
sql::db_connection_pool::{sqlitepool::SqliteConnectionPoolFactory, Mode},
64
sqlite::SqliteTableFactory,
75
};
6+
use std::sync::Arc;
7+
use std::time::Duration;
88

99
/// This example demonstrates how to create a SqliteTableFactory and use it to create TableProviders
1010
/// that can be registered with DataFusion.
1111
#[tokio::main]
1212
async fn main() {
1313
let sqlite_pool = Arc::new(
14-
SqliteConnectionPoolFactory::new("examples/sqlite_example.db", Mode::File, Duration::default())
15-
.build()
16-
.await
17-
.expect("unable to create Sqlite connection pool"),
14+
SqliteConnectionPoolFactory::new(
15+
"examples/sqlite_example.db",
16+
Mode::File,
17+
Duration::default(),
18+
)
19+
.build()
20+
.await
21+
.expect("unable to create Sqlite connection pool"),
1822
);
1923

2024
let sqlite_table_factory = SqliteTableFactory::new(sqlite_pool);

src/flight/exec.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,7 @@ pub fn enforce_schema(
240240
/// For a target schema field, extract the column with the same name if present in the
241241
/// record batch and cast it to the desired data type if needed. If the column is missing
242242
/// but the target schema field is nullable, generates a null-array column.
243-
fn find_matching_column(
244-
batch: &RecordBatch,
245-
field: &Field,
246-
) -> arrow::error::Result<ArrayRef> {
243+
fn find_matching_column(batch: &RecordBatch, field: &Field) -> arrow::error::Result<ArrayRef> {
247244
if let Some(column) = batch.column_by_name(field.name()) {
248245
if column.data_type() == field.data_type() {
249246
Ok(column.to_owned())

0 commit comments

Comments
 (0)