| 109 | } |
| 110 | |
| 111 | Status QueryDriver::SetExternalPlan( |
| 112 | const TQueryCtx& query_ctx, TExecRequest external_exec_request) { |
| 113 | DCHECK(client_request_state_ != nullptr); |
| 114 | DCHECK(exec_request_ == nullptr); |
| 115 | |
| 116 | if (!FLAGS_dump_exec_request_path.empty()) { |
| 117 | // Create and dump Impala planner results so we can compare with the external plan. |
| 118 | RETURN_IF_ERROR(DoFrontendPlanning(query_ctx, false)); |
| 119 | } |
| 120 | |
| 121 | RETURN_IF_ERROR( |
| 122 | DebugAction(query_ctx.client_request.query_options, "FRONTEND_PLANNER")); |
| 123 | // Update query_id in the external request |
| 124 | external_exec_request.query_exec_request.query_ctx.__set_query_id( |
| 125 | client_request_state_->query_id()); |
| 126 | // Update coordinator related internal addresses in the external request |
| 127 | external_exec_request.query_exec_request.query_ctx.__set_coord_hostname( |
| 128 | ExecEnv::GetInstance()->configured_backend_address().hostname); |
| 129 | const TNetworkAddress& address = |
| 130 | FromNetworkAddressPB(ExecEnv::GetInstance()->krpc_address()); |
| 131 | DCHECK(IsResolvedAddress(address)); |
| 132 | external_exec_request.query_exec_request.query_ctx.__set_coord_ip_address(address); |
| 133 | // Update local_time_zone in the external request |
| 134 | external_exec_request.query_exec_request.query_ctx.__set_local_time_zone( |
| 135 | query_ctx.local_time_zone); |
| 136 | external_exec_request.query_exec_request.query_ctx.__set_now_string( |
| 137 | query_ctx.now_string); |
| 138 | exec_request_.reset(new TExecRequest(move(external_exec_request))); |
| 139 | |
| 140 | DumpTExecReq(*exec_request_, "external", client_request_state_->query_id()); |
| 141 | client_request_state_->SetExecRequest(exec_request_.get()); |
| 142 | return Status::OK(); |
| 143 | } |
| 144 | |
| 145 | ClientRequestState* QueryDriver::GetActiveClientRequestState() { |
| 146 | lock_guard<SpinLock> l(client_request_state_lock_); |
no test coverage detected