| 218 | } |
| 219 | |
| 220 | QueryStateExpanded::QueryStateExpanded( |
| 221 | const ClientRequestState& exec_state, std::shared_ptr<QueryStateRecord> base) |
| 222 | : base_state(base ? move(base) : make_shared<QueryStateRecord>(exec_state)) { |
| 223 | if (exec_state.session()->session_type == TSessionType::HIVESERVER2){ |
| 224 | hiveserver2_protocol_version = exec_state.session()->hs2_version; |
| 225 | } |
| 226 | query_options = exec_state.query_options(); |
| 227 | session_id = exec_state.session_id(); |
| 228 | session_type = exec_state.session()->session_type; |
| 229 | redacted_sql = exec_state.redacted_sql(); |
| 230 | db_user_connection = exec_state.connected_user(); |
| 231 | client_address = exec_state.session()->network_address; |
| 232 | impala_query_end_state = exec_state.ExecStateToString(exec_state.exec_state()); |
| 233 | per_host_mem_estimate = exec_state.exec_request() |
| 234 | .query_exec_request.planner_per_host_mem_estimate; |
| 235 | dedicated_coord_mem_estimate = exec_state.exec_request() |
| 236 | .query_exec_request.dedicated_coord_mem_estimate; |
| 237 | row_materialization_rate = exec_state.row_materialization_rate(); |
| 238 | row_materialization_time = exec_state.row_materialization_timer(); |
| 239 | tables = exec_state.tables(); |
| 240 | select_columns = exec_state.select_columns(); |
| 241 | where_columns = exec_state.where_columns(); |
| 242 | join_columns = exec_state.join_columns(); |
| 243 | aggregate_columns = exec_state.aggregate_columns(); |
| 244 | orderby_columns = exec_state.orderby_columns(); |
| 245 | |
| 246 | // Update name_rows_fetched with the final count after query close. |
| 247 | base_state->num_rows_fetched = exec_state.num_rows_fetched_counter(); |
| 248 | |
| 249 | // Fields from the schedule. |
| 250 | if (exec_state.schedule() != nullptr) { |
| 251 | // Per-Host Metrics |
| 252 | for (int i =0; i < exec_state.schedule()->backend_exec_params_size(); i++) { |
| 253 | const BackendExecParamsPB& b = exec_state.schedule()->backend_exec_params(i); |
| 254 | TNetworkAddress host = FromNetworkAddressPB(b.address()); |
| 255 | |
| 256 | PerHostState state; |
| 257 | state.fragment_instance_count = b.instance_params_size(); |
| 258 | per_host_state.emplace(move(host), move(state)); |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | // Fields from the summary profile. |
| 263 | if (exec_state.summary_profile() != nullptr) { |
| 264 | const string* result_ptr = exec_state.summary_profile() |
| 265 | ->GetInfoString(AdmissionController::PROFILE_INFO_KEY_ADMISSION_RESULT); |
| 266 | admission_result = result_ptr == nullptr ? "" : *result_ptr; |
| 267 | |
| 268 | const string* exec_group_ptr = exec_state.summary_profile() |
| 269 | ->GetInfoString(AdmissionController::PROFILE_INFO_KEY_EXECUTOR_GROUP); |
| 270 | executor_group = exec_group_ptr == nullptr ? "" : *exec_group_ptr; |
| 271 | |
| 272 | const string* exec_summary_ptr = exec_state.summary_profile()-> |
| 273 | GetInfoString("ExecSummary"); |
| 274 | if (exec_summary_ptr != nullptr && !exec_summary_ptr->empty()) { |
| 275 | exec_summary = *exec_summary_ptr; |
| 276 | boost::algorithm::trim_if(exec_summary, boost::algorithm::is_any_of("\n")); |
| 277 | } |
nothing calls this directly
no test coverage detected