Skip to content

Commit

Permalink
4
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyiZzz committed Nov 3, 2024
1 parent 8574fb8 commit 4c36c97
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion be/src/service/arrow_flight/flight_sql_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<QueryStatement> statement =
std::make_shared<QueryStatement>(queryid, result_addr, sql);
Expand Down
4 changes: 2 additions & 2 deletions be/src/service/internal_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

/**
* Process one flgiht sql connection.
*
* <p>
* Must use try-with-resources.
*/
public class FlightSqlConnectProcessor extends ConnectProcessor implements AutoCloseable {
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 4c36c97

Please sign in to comment.