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


##########
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:
   Calling `Arc::clone(df_schema.as_ref())` often doesn't work, i.e. when 
df_schema is inside the Arc and Arc's `as_ref` gets invoked instead. In these 
cases we can `.as_ref().as_ref()` or perhaps `.inner()`. I updated the code to 
the latter, since it's shorter.



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