Skip to content

Commit

Permalink
[standalone pem] Fix execution stats. (#1737)
Browse files Browse the repository at this point in the history
Summary: We update the code to populate the execution stats data using
`mutable` so that the data is written into message that will be sent on
the wire. Previously, our code created a copy of the execution stats and
updated that. The copy left the upstream message empty and consequently
nothing was sent on the wire.

Type of change: /kind bug fix.

Test Plan: We discovered this bug when testing with the px go api.
Standalone pem would work when using streaming, but the client api
program would fail for batched. The cause of the failure was an
unidentified message data type, i.e. a completely empty execution stats
data field. We successfully re-tested the batched query with a
standalone pem and the go px api.

---------

Signed-off-by: Pete Stevenson <[email protected]>
  • Loading branch information
Pete Stevenson authored Nov 2, 2023
1 parent e04a764 commit 6526dcc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/experimental/standalone_pem/sink_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,12 @@ class StandaloneResultSinkServer final : public carnotpb::ResultSinkService::Ser
void HandleExecutionAndTimingInfo(::px::api::vizierpb::ExecuteScriptResponse* resp,
carnotpb::TransferResultChunkRequest* rb) {
auto timing_info = rb->execution_and_timing_info();
auto stats = resp->mutable_data()->execution_stats();
stats.set_bytes_processed(timing_info.execution_stats().bytes_processed());
stats.set_records_processed(timing_info.execution_stats().records_processed());
auto timing = stats.timing();
timing.set_execution_time_ns(timing_info.execution_stats().timing().execution_time_ns());
timing.set_compilation_time_ns(timing_info.execution_stats().timing().compilation_time_ns());
auto stats = resp->mutable_data()->mutable_execution_stats();
stats->set_bytes_processed(timing_info.execution_stats().bytes_processed());
stats->set_records_processed(timing_info.execution_stats().records_processed());
auto timing = stats->mutable_timing();
timing->set_execution_time_ns(timing_info.execution_stats().timing().execution_time_ns());
timing->set_compilation_time_ns(timing_info.execution_stats().timing().compilation_time_ns());
}

absl::flat_hash_map<sole::uuid, ::grpc::ServerWriter<::px::api::vizierpb::ExecuteScriptResponse>*>
Expand Down

0 comments on commit 6526dcc

Please sign in to comment.