1717
1818use async_trait:: async_trait;
1919use bytes:: Bytes ;
20+ use datafusion_common_runtime:: SpawnedTask ;
2021use futures:: { SinkExt , StreamExt } ;
2122use log:: { debug, info} ;
2223use sqllogictest:: DBOutput ;
2324/// Postgres engine implementation for sqllogictest.
2425use std:: path:: { Path , PathBuf } ;
2526use std:: str:: FromStr ;
2627use std:: time:: Duration ;
27- use tokio:: task:: JoinHandle ;
2828
2929use super :: conversion:: * ;
3030use crate :: engines:: output:: { DFColumnType , DFOutput } ;
@@ -54,7 +54,7 @@ pub type Result<T, E = Error> = std::result::Result<T, E>;
5454
5555pub struct Postgres {
5656 client : tokio_postgres:: Client ,
57- join_handle : JoinHandle < ( ) > ,
57+ _spawned_task : SpawnedTask < ( ) > ,
5858 /// Relative test file path
5959 relative_path : PathBuf ,
6060 pb : ProgressBar ,
@@ -90,7 +90,7 @@ impl Postgres {
9090
9191 let ( client, connection) = res?;
9292
93- let join_handle = tokio :: spawn ( async move {
93+ let _spawned_task = SpawnedTask :: spawn ( async move {
9494 if let Err ( e) = connection. await {
9595 log:: error!( "Postgres connection error: {:?}" , e) ;
9696 }
@@ -114,7 +114,7 @@ impl Postgres {
114114
115115 Ok ( Self {
116116 client,
117- join_handle ,
117+ _spawned_task ,
118118 relative_path,
119119 pb,
120120 } )
@@ -222,12 +222,6 @@ fn schema_name(relative_path: &Path) -> String {
222222 . to_string ( )
223223}
224224
225- impl Drop for Postgres {
226- fn drop ( & mut self ) {
227- self . join_handle . abort ( )
228- }
229- }
230-
231225#[ async_trait]
232226impl sqllogictest:: AsyncDB for Postgres {
233227 type Error = Error ;
0 commit comments