findepi commented on code in PR #17643:
URL: https://github.com/apache/datafusion/pull/17643#discussion_r2360684683


##########
datafusion-examples/examples/flight/flight_server.rs:
##########
@@ -98,7 +99,7 @@ impl FlightService for FlightServiceImpl {
                 let df = ctx.sql(sql).await.map_err(to_tonic_err)?;
 
                 // execute the query
-                let schema = df.schema().clone().into();
+                let schema: SchemaRef = df.schema().into();

Review Comment:
   This PR adds `impl From<&DFSchema> for SchemaRef`. I can retract it, no 
problem.
   However,   it will make it easier to reach out to pre-existing `impl 
From<&DFSchema> for Schema` and wrap in `Arc::new` (instead of `Arc::clone`).
   The question is not how to write correct cheap arc cloning code. The 
question is how to write cheap code while not thinking about this specifically.
   



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to