diff --git a/be/src/service/arrow_flight/flight_sql_service.cpp b/be/src/service/arrow_flight/flight_sql_service.cpp index c042c7b2aa6d0ba..a9790e1e0050d38 100644 --- a/be/src/service/arrow_flight/flight_sql_service.cpp +++ b/be/src/service/arrow_flight/flight_sql_service.cpp @@ -56,7 +56,7 @@ class FlightSqlServer::Impl { result_addr.hostname = fields[1]; result_addr.port = std::stoi(fields[2]); std::string sql = fields[3]; - LOG(INFO) << "ArrowFlightBatchRemoteReader bbbb " << result_addr.hostname << ", " << sql; + LOG(INFO) << "ArrowFlightBatchRemoteReader bbbb " << result_addr.hostname << ", " << result_addr.port << ", " << sql; std::shared_ptr statement = std::make_shared(queryid, result_addr, sql); diff --git a/be/src/service/internal_service.cpp b/be/src/service/internal_service.cpp index d044fe5607071d7..f8442f0d419c023 100644 --- a/be/src/service/internal_service.cpp +++ b/be/src/service/internal_service.cpp @@ -913,10 +913,10 @@ void PInternalService::fetch_arrow_flight_schema(google::protobuf::RpcController auto st = serialize_arrow_schema(&schema, &schema_str); if (st.ok()) { result->set_schema(std::move(schema_str)); - if (config::public_access_ip != "") { + if (!config::public_access_ip.empty()) { result->set_be_arrow_flight_ip(config::public_access_ip); } - if (config::public_access_port != "-1") { + if (config::public_access_port != -1) { result->set_be_arrow_flight_port(config::public_access_port); } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/FlightSqlConnectProcessor.java b/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/FlightSqlConnectProcessor.java index b812bf81d8a5146..840992a7a14a151 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/FlightSqlConnectProcessor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/FlightSqlConnectProcessor.java @@ -53,7 +53,7 @@ /** * Process one flgiht sql connection. - * + *

* Must use try-with-resources. */ public class FlightSqlConnectProcessor extends ConnectProcessor implements AutoCloseable { @@ -130,11 +130,14 @@ public Schema fetchArrowFlightSchema(int timeoutMs) { Status resultStatus = new Status(pResult.getStatus()); if (resultStatus.getErrorCode() != TStatusCode.OK) { throw new RuntimeException(String.format("fetch arrow flight schema failed, queryId: %s, errmsg: %s", - DebugUtil.printId(tid), resultStatus.toString())); + DebugUtil.printId(tid), resultStatus)); } if (pResult.hasBeArrowFlightIp()) { ctx.getResultFlightServerAddr().hostname = pResult.getBeArrowFlightIp().toStringUtf8(); } + if (pResult.hasBeArrowFlightPort()) { + ctx.getResultFlightServerAddr().port = pResult.getBeArrowFlightPort(); + } if (pResult.hasSchema() && pResult.getSchema().size() > 0) { RootAllocator rootAllocator = new RootAllocator(Integer.MAX_VALUE); ArrowStreamReader arrowStreamReader = new ArrowStreamReader(