milenkovicm commented on code in PR #1351:
URL:
https://github.com/apache/datafusion-ballista/pull/1351#discussion_r2714219542
##########
ballista/core/src/execution_plans/distributed_query.rs:
##########
@@ -415,22 +426,75 @@ async fn execute_query(
}
}
+fn get_client_host_port(
+ executor_metadata: &ExecutorMetadata,
+ scheduler_url: &str,
+ flight_proxy: &Option<FlightProxy>,
+) -> Result<(String, u16)> {
+ fn split_host_port(address: &str) -> Result<(String, u16)> {
+ let url: Url = address.parse().map_err(|e| {
+ DataFusionError::Execution(format!(
+ "Cannot parse host:port in {address:?}: {e}"
+ ))
+ })?;
+ let host = url
+ .host_str()
+ .ok_or(DataFusionError::Execution(format!(
+ "No host in {address:?}"
+ )))?
+ .to_string();
+ let port: u16 = url.port().ok_or(DataFusionError::Execution(format!(
+ "No port in {address:?}"
+ )))?;
+ Ok((host, port))
+ }
+
+ match flight_proxy {
+ Some(FlightProxy::External(address)) => {
+ info!("Fetching results from external flight proxy: {}", address);
Review Comment:
please use debug
##########
ballista/core/src/execution_plans/distributed_query.rs:
##########
@@ -415,22 +426,75 @@ async fn execute_query(
}
}
+fn get_client_host_port(
+ executor_metadata: &ExecutorMetadata,
+ scheduler_url: &str,
+ flight_proxy: &Option<FlightProxy>,
+) -> Result<(String, u16)> {
+ fn split_host_port(address: &str) -> Result<(String, u16)> {
+ let url: Url = address.parse().map_err(|e| {
+ DataFusionError::Execution(format!(
+ "Cannot parse host:port in {address:?}: {e}"
+ ))
+ })?;
+ let host = url
+ .host_str()
+ .ok_or(DataFusionError::Execution(format!(
+ "No host in {address:?}"
+ )))?
+ .to_string();
+ let port: u16 = url.port().ok_or(DataFusionError::Execution(format!(
+ "No port in {address:?}"
+ )))?;
+ Ok((host, port))
+ }
+
+ match flight_proxy {
+ Some(FlightProxy::External(address)) => {
+ info!("Fetching results from external flight proxy: {}", address);
+ split_host_port(format!("http://{address}").as_str())
+ }
+ Some(FlightProxy::Local(true)) => {
+ info!("Fetching results from scheduler: {}", scheduler_url);
Review Comment:
please use debug
##########
ballista/scheduler/src/scheduler_process.rs:
##########
@@ -96,6 +99,24 @@ pub async fn start_grpc_service<
let mut tonic_builder = RoutesBuilder::default();
tonic_builder.add_service(scheduler_grpc_server);
+ match &config.advertise_flight_sql_endpoint {
+ Some(proxy) if proxy.is_empty() => {
+ info!("Adding embeddded flight proxy service on scheduler");
Review Comment:
typo `embedded`
##########
ballista/core/src/execution_plans/distributed_query.rs:
##########
@@ -415,22 +426,75 @@ async fn execute_query(
}
}
+fn get_client_host_port(
+ executor_metadata: &ExecutorMetadata,
+ scheduler_url: &str,
+ flight_proxy: &Option<FlightProxy>,
+) -> Result<(String, u16)> {
+ fn split_host_port(address: &str) -> Result<(String, u16)> {
+ let url: Url = address.parse().map_err(|e| {
+ DataFusionError::Execution(format!(
+ "Cannot parse host:port in {address:?}: {e}"
+ ))
+ })?;
+ let host = url
+ .host_str()
+ .ok_or(DataFusionError::Execution(format!(
+ "No host in {address:?}"
+ )))?
+ .to_string();
+ let port: u16 = url.port().ok_or(DataFusionError::Execution(format!(
+ "No port in {address:?}"
+ )))?;
+ Ok((host, port))
+ }
+
+ match flight_proxy {
+ Some(FlightProxy::External(address)) => {
+ info!("Fetching results from external flight proxy: {}", address);
+ split_host_port(format!("http://{address}").as_str())
+ }
+ Some(FlightProxy::Local(true)) => {
+ info!("Fetching results from scheduler: {}", scheduler_url);
+ split_host_port(scheduler_url)
+ }
+ Some(FlightProxy::Local(false)) | None => {
+ info!(
Review Comment:
please use debug
--
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]