andygrove commented on code in PR #442:
URL: https://github.com/apache/arrow-ballista/pull/442#discussion_r1005699055


##########
ballista/scheduler/src/flight_sql.rs:
##########
@@ -196,26 +196,48 @@ impl FlightSqlServiceImpl {
     ) -> Result<Vec<FlightEndpoint>, Status> {
         let mut fieps: Vec<_> = vec![];
         for loc in completed.partition_location.iter() {
-            let (host, port) = if let Some(ref md) = loc.executor_meta {
+            let (exec_host, exec_port) = if let Some(ref md) = 
loc.executor_meta {
                 (md.host.clone(), md.port)
             } else {
                 Err(Status::internal(
-                    "Invalid partition location, missing executor 
metadata".to_string(),
+                    "Invalid partition location, missing executor metadata and 
advertise_endpoint flag is undefined.".to_string(),
                 ))?
             };
+
+            let (host, port) = match self.server.advertise_endpoint {
+                Some(_) => {
+                    let advertise_endpoint_vec: Vec<&str> = self
+                        .server
+                        .advertise_endpoint
+                        .as_ref()
+                        .expect("Failed to parse advertise_endpoint value")

Review Comment:
   The endpoint is already available from the pattern matching and the `expect` 
code is unreachable. This can be simplified:
   
   ```suggestion
               let (host, port) = match &self.server.advertise_endpoint {
                   Some(endpoint) => {
                       let advertise_endpoint_vec: Vec<&str> = endpoint
   ```



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

Reply via email to