Skip to content
This repository was archived by the owner on Oct 21, 2024. It is now read-only.

Commit 788feef

Browse files
committed
code cleanup
1 parent 9c47338 commit 788feef

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

rust/datafusion/examples/flight-server.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,9 @@ impl FlightService for FlightServiceImpl {
7474
// create the query plan
7575
let plan = ctx
7676
.create_logical_plan(&sql)
77+
.and_then(|plan| ctx.optimize(&plan))
78+
.and_then(|plan| ctx.create_physical_plan(&plan, 1024 * 1024))
7779
.map_err(|e| to_tonic_err(&e))?;
78-
let plan = ctx.optimize(&plan).map_err(|e| to_tonic_err(&e))?;
79-
let plan = ctx
80-
.create_physical_plan(&plan, 1024 * 1024)
81-
.map_err(|e| to_tonic_err(&e))?;
82-
83-
//TODO make this async
8480

8581
// execute the query
8682
let results = ctx.collect(plan.as_ref()).map_err(|e| to_tonic_err(&e))?;

0 commit comments

Comments
 (0)