11use arrow:: util:: pretty:: pretty_format_batches;
2+ use arrow_flight:: flight_service_client:: FlightServiceClient ;
23use arrow_flight:: flight_service_server:: FlightServiceServer ;
34use async_trait:: async_trait;
45use datafusion:: common:: DataFusionError ;
56use datafusion:: execution:: SessionStateBuilder ;
67use datafusion:: physical_plan:: displayable;
78use datafusion:: prelude:: { ParquetReadOptions , SessionContext } ;
89use datafusion_distributed:: {
9- ArrowFlightEndpoint , BoxCloneSyncChannel , ChannelResolver , DistributedExt ,
10- DistributedPhysicalOptimizerRule , DistributedSessionBuilderContext ,
10+ ArrowFlightEndpoint , ChannelResolver , DistributedExt , DistributedPhysicalOptimizerRule ,
11+ DistributedSessionBuilderContext ,
1112} ;
1213use futures:: TryStreamExt ;
1314use hyper_util:: rt:: TokioIo ;
@@ -75,7 +76,7 @@ const DUMMY_URL: &str = "http://localhost:50051";
7576/// tokio duplex rather than a TCP connection.
7677#[ derive( Clone ) ]
7778struct InMemoryChannelResolver {
78- channel : BoxCloneSyncChannel ,
79+ channel : FlightServiceClient < tonic :: transport :: Channel > ,
7980}
8081
8182impl InMemoryChannelResolver {
@@ -93,7 +94,7 @@ impl InMemoryChannelResolver {
9394 } ) ) ;
9495
9596 let this = Self {
96- channel : BoxCloneSyncChannel :: new ( channel) ,
97+ channel : FlightServiceClient :: new ( channel) ,
9798 } ;
9899 let this_clone = this. clone ( ) ;
99100
@@ -127,10 +128,10 @@ impl ChannelResolver for InMemoryChannelResolver {
127128 Ok ( vec ! [ url:: Url :: parse( DUMMY_URL ) . unwrap( ) ] )
128129 }
129130
130- async fn get_channel_for_url (
131+ async fn get_flight_client_for_url (
131132 & self ,
132133 _: & url:: Url ,
133- ) -> Result < BoxCloneSyncChannel , DataFusionError > {
134+ ) -> Result < FlightServiceClient < tonic :: transport :: Channel > , DataFusionError > {
134135 Ok ( self . channel . clone ( ) )
135136 }
136137}
0 commit comments