MCPcopy Create free account
hub / github.com/apache/impala / UpdateTableAndColumnStats

Method UpdateTableAndColumnStats

be/src/service/client-request-state.cc:2034–2074  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2032}
2033
2034Status ClientRequestState::UpdateTableAndColumnStats(
2035 const vector<ChildQuery*>& child_queries) {
2036 DCHECK_GE(child_queries.size(), 1);
2037 DCHECK_LE(child_queries.size(), 2);
2038 catalog_op_executor_.reset(
2039 new CatalogOpExecutor(ExecEnv::GetInstance(), frontend_, server_profile_));
2040
2041 // If there was no column stats query, pass in empty thrift structures to
2042 // ExecComputeStats(). Otherwise pass in the column stats result.
2043 TTableSchema col_stats_schema;
2044 TRowSet col_stats_data;
2045 if (child_queries.size() > 1) {
2046 col_stats_schema = child_queries[1]->result_schema();
2047 col_stats_data = child_queries[1]->result_data();
2048 }
2049
2050 const TExecRequest& exec_req = exec_request();
2051
2052 std::optional<long> snapshot_id = getIcebergSnapshotId(exec_req);
2053 Status status = catalog_op_executor_->ExecComputeStats(
2054 GetCatalogServiceRequestHeader(),
2055 exec_req.catalog_op_request,
2056 child_queries[0]->result_schema(),
2057 child_queries[0]->result_data(),
2058 col_stats_schema,
2059 col_stats_data,
2060 snapshot_id);
2061 AddCatalogTimeline();
2062 {
2063 lock_guard<mutex> l(lock_);
2064 RETURN_IF_ERROR(UpdateQueryStatus(status));
2065 }
2066 RETURN_IF_ERROR(parent_server_->ProcessCatalogUpdateResult(
2067 *catalog_op_executor_->update_catalog_result(),
2068 exec_req.query_options.sync_ddl, query_options(), query_events_));
2069
2070 // Set the results to be reported to the client.
2071 SetResultSet(catalog_op_executor_->ddl_exec_response());
2072 query_events_->MarkEvent("Metastore update finished");
2073 return Status::OK();
2074}
2075
2076void ClientRequestState::ClearResultCache() {
2077 if (result_cache_ == nullptr) return;

Callers

nothing calls this directly

Calls 9

getIcebergSnapshotIdFunction · 0.85
OKFunction · 0.85
ExecComputeStatsMethod · 0.80
update_catalog_resultMethod · 0.80
MarkEventMethod · 0.80
resetMethod · 0.65
sizeMethod · 0.45
ddl_exec_responseMethod · 0.45

Tested by

no test coverage detected