Skip to content

Commit

Permalink
fixup! fixup! Generic Arrow Flight RPC data source with a Flight SQL …
Browse files Browse the repository at this point in the history
…adapter
  • Loading branch information
ccciudatu committed Aug 12, 2024
1 parent fc38f34 commit 6f6e857
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions datafusion/core/src/datasource/flight/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl FlightTableFactory {
&self,
location: String,
options: &HashMap<String, String>
) -> datafusion_common::Result<Arc<dyn TableProvider>> {
) -> datafusion_common::Result<FlightTable> {
let channel = Channel::from_shared(location.clone())
.unwrap()
.connect()
Expand All @@ -111,10 +111,10 @@ impl FlightTableFactory {
.metadata(channel, options)
.await
.map_err(|e| DataFusionError::External(Box::new(e)))?;
Ok(Arc::new(FlightTable {
Ok(FlightTable {
metadata,
origin: location,
}))
})
}
}

Expand All @@ -125,7 +125,8 @@ impl TableProviderFactory for FlightTableFactory {
_state: &SessionState,
cmd: &CreateExternalTable,
) -> datafusion_common::Result<Arc<dyn TableProvider>> {
self.open_table(cmd.location.to_owned(), &cmd.options).await
let table = self.open_table(cmd.location.to_owned(), &cmd.options).await?;
Ok(Arc::new(table))
}
}

Expand Down Expand Up @@ -186,7 +187,7 @@ impl TryFrom<FlightInfo> for FlightMetadata {
}

/// Table provider that wraps a specific flight from an Arrow Flight service
struct FlightTable {
pub struct FlightTable {
metadata: FlightMetadata,
origin: String,
}
Expand Down

0 comments on commit 6f6e857

Please sign in to comment.