Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ccciudatu committed Oct 22, 2024
1 parent 8dbaca9 commit f7887a9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
16 changes: 10 additions & 6 deletions examples/sqlite.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
use std::sync::Arc;
use std::time::Duration;
use datafusion::{prelude::SessionContext, sql::TableReference};
use datafusion_table_providers::{
sql::db_connection_pool::{sqlitepool::SqliteConnectionPoolFactory, Mode},
sqlite::SqliteTableFactory,
};
use std::sync::Arc;
use std::time::Duration;

/// This example demonstrates how to create a SqliteTableFactory and use it to create TableProviders
/// that can be registered with DataFusion.
#[tokio::main]
async fn main() {
let sqlite_pool = Arc::new(
SqliteConnectionPoolFactory::new("examples/sqlite_example.db", Mode::File, Duration::default())
.build()
.await
.expect("unable to create Sqlite connection pool"),
SqliteConnectionPoolFactory::new(
"examples/sqlite_example.db",
Mode::File,
Duration::default(),
)
.build()
.await
.expect("unable to create Sqlite connection pool"),
);

let sqlite_table_factory = SqliteTableFactory::new(sqlite_pool);
Expand Down
5 changes: 1 addition & 4 deletions src/flight/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,7 @@ pub fn enforce_schema(
/// For a target schema field, extract the column with the same name if present in the
/// record batch and cast it to the desired data type if needed. If the column is missing
/// but the target schema field is nullable, generates a null-array column.
fn find_matching_column(
batch: &RecordBatch,
field: &Field,
) -> arrow::error::Result<ArrayRef> {
fn find_matching_column(batch: &RecordBatch, field: &Field) -> arrow::error::Result<ArrayRef> {
if let Some(column) = batch.column_by_name(field.name()) {
if column.data_type() == field.data_type() {
Ok(column.to_owned())
Expand Down

0 comments on commit f7887a9

Please sign in to comment.