Dandandan commented on a change in pull request #9645: URL: https://github.com/apache/arrow/pull/9645#discussion_r592744922
########## File path: rust/datafusion/examples/flight_server.rs ########## @@ -94,28 +94,26 @@ impl FlightService for FlightServiceImpl { "alltypes_plain", &format!("{}/alltypes_plain.parquet", testdata), ) - .map_err(|e| to_tonic_err(&e))?; + .map_err(to_tonic_err)?; - // create the query plan - let plan = ctx - .create_logical_plan(&sql) - .and_then(|plan| ctx.optimize(&plan)) - .and_then(|plan| ctx.create_physical_plan(&plan)) - .map_err(|e| to_tonic_err(&e))?; + // create the DataFrame + let df = ctx.sql(sql).map_err(to_tonic_err)?; // execute the query - let results = - collect(plan.clone()).await.map_err(|e| to_tonic_err(&e))?; + let results = df.collect().await.map_err(to_tonic_err)?; if results.is_empty() { return Err(Status::internal("There were no results from ticket")); } + let physical_plan = ctx Review comment: Agree, your comment makes sense. Will have a look later. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org