This example shows how to wrap DataFusion with `FlightService` to support looking up schema information for Parquet files and executing SQL queries against them on a remote server. This example is run along-side the example `flight_client`.
()
| 202 | /// Parquet files and executing SQL queries against them on a remote server. |
| 203 | /// This example is run along-side the example `flight_client`. |
| 204 | pub async fn server() -> Result<(), Box<dyn std::error::Error>> { |
| 205 | let addr = "0.0.0.0:50051".parse()?; |
| 206 | let service = FlightServiceImpl {}; |
| 207 | |
| 208 | let svc = FlightServiceServer::new(service); |
| 209 | |
| 210 | println!("Listening on {addr:?}"); |
| 211 | |
| 212 | Server::builder().add_service(svc).serve(addr).await?; |
| 213 | |
| 214 | Ok(()) |
| 215 | } |