Skip to content

Commit

Permalink
Improve
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrebnov committed Jul 5, 2024
1 parent a023db7 commit f0d147e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/duckdb/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ impl DataSink for DuckDBDataSink {
mut data: SendableRecordBatchStream,
_context: &Arc<TaskContext>,
) -> datafusion::common::Result<u64> {
let duckdb = self.duckdb.clone();
let duckdb = Arc::clone(&self.duckdb);
let overwrite = self.overwrite;
let on_conflict = self.on_conflict.clone();

Expand All @@ -133,7 +133,7 @@ impl DataSink for DuckDBDataSink {
flume::bounded(100);

let duckdb_write_handle: JoinHandle<datafusion::common::Result<u64>> =
tokio::spawn(async move {
tokio::task::spawn_blocking(move || {
let mut db_conn = duckdb.connect_sync().map_err(to_datafusion_error)?;

let duckdb_conn = DuckDB::duckdb_conn(&mut db_conn).map_err(to_datafusion_error)?;
Expand Down

0 comments on commit f0d147e

Please sign in to comment.