Files
impala/common/thrift/ExecStats.thrift
Martin Grund ed18dd4a8b IMPALA-80: Dynamic progress reporting for the shell
This patch adds a way to allow for dynamic progress reporting in the
shell. There are two new command line flags for the shell

   --live_progress - will print the completed vs total # of scan ranges
   --live_summary - prints an updated exec summary

In addition to the command line flags, these options can be set from
within the shell using:

   set LIVE_SUMMARY=True
   set LIVE_PROGRESS=True

The new options will be listed under shell options. Both reports will be
updated at most every second, for longer running queries it will be
adjusted to the time between two RPC calls to get the query status. To
provide this information in the ExecSummary, the Thrift structure for
the ExecSummary was extended to contain a progress indicator. The output
is printed to stderr and only available in interactive mode.

An example video is available here:

https://asciinema.org/a/5wi7ypckx4ol4ha1hlg3e3q1k

Change-Id: I70b2ab5fa74dc2ba5bc3b338ef13ddc6ccf367d2
Reviewed-on: http://gerrit.cloudera.org:8080/508
Tested-by: Internal Jenkins
Reviewed-by: Martin Grund <mgrund@cloudera.com>
2015-07-17 17:59:29 +00:00

104 lines
3.2 KiB
Thrift

// Copyright 2012 Cloudera Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
namespace cpp impala
namespace java com.cloudera.impala.thrift
include "Status.thrift"
include "Types.thrift"
enum TExecState {
REGISTERED = 0,
PLANNING = 1,
QUEUED = 2,
RUNNING = 3,
FINISHED = 4,
CANCELLED = 5,
FAILED = 6,
}
// Execution stats for a single plan node.
struct TExecStats {
// The wall clock time spent on the "main" thread. This is the user perceived
// latency. This value indicates the current bottleneck.
// Note: anywhere we have a queue between operators, this time can fluctuate
// significantly without the overall query time changing much (i.e. the bottleneck
// moved to another operator). This is unavoidable though.
1: optional i64 latency_ns
// Total CPU time spent across all threads. For operators that have an async
// component (e.g. multi-threaded) this will be >= latency_ns.
2: optional i64 cpu_time_ns
// Number of rows returned.
3: optional i64 cardinality
// Peak memory used (in bytes).
4: optional i64 memory_used
}
// Summary for a single plan node. This includes labels for how to display the
// node as well as per instance stats.
struct TPlanNodeExecSummary {
1: required Types.TPlanNodeId node_id
2: required i32 fragment_id
3: required string label
4: optional string label_detail
5: required i32 num_children
// Estimated stats generated by the planner
6: optional TExecStats estimated_stats
// One entry for each BE executing this plan node.
7: optional list<TExecStats> exec_stats
// One entry for each BE executing this plan node. True if this plan node is still
// running.
8: optional list<bool> is_active
// If true, this plan node is an exchange node that is the receiver of a broadcast.
9: optional bool is_broadcast
}
// Progress counters for an in-flight query.
struct TExecProgress {
1: optional i64 total_scan_ranges
2: optional i64 num_completed_scan_ranges
}
// Execution summary of an entire query.
struct TExecSummary {
// State of the query.
1: required TExecState state
// Contains the error if state is FAILED.
2: optional Status.TStatus status
// Flattened execution summary of the plan tree.
3: optional list<TPlanNodeExecSummary> nodes
// For each exch node in 'nodes', contains the index to the root node of the sending
// fragment for this exch. Both the key and value are indices into 'nodes'.
4: optional map<i32, i32> exch_to_sender_map
// List of errors that were encountered during execution. This can be non-empty
// even if status is okay, in which case it contains errors that impala skipped
// over.
5: optional list<string> error_logs
// Optional record indicating the query progress
6: optional TExecProgress progress
}