You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by st...@apache.org on 2019/12/09 22:39:01 UTC
[impala] branch master updated (4093975 -> 85425b8)
This is an automated email from the ASF dual-hosted git repository.
stakiar pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git.
from 4093975 Update mvn snapshot dependencies in "clean" checkouts
new f608be7 IMPALA-9219: [DOCS] ISO-SQL 2016 Date/time format patters - Milestone 3
new 306b606 IMPALA-9207: [DOCS] Documented the #Inst in exec summary
new 85425b8 IMPALA-9124: ImpalaServer and ClientRequestState refactoring
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
be/src/service/client-request-state-map.h | 74 ++
be/src/service/client-request-state.cc | 22 +-
be/src/service/client-request-state.h | 31 +-
be/src/service/impala-server.cc | 67 +-
be/src/service/impala-server.h | 20 +-
docs/topics/impala_conversion_functions.xml | 1128 ++++++++++++++++++++-------
docs/topics/impala_explain_plan.xml | 639 ++++-----------
docs/topics/impala_live_summary.xml | 128 ---
docs/topics/impala_mem_limit.xml | 22 +-
9 files changed, 1154 insertions(+), 977 deletions(-)
create mode 100644 be/src/service/client-request-state-map.h
[impala] 03/03: IMPALA-9124: ImpalaServer and ClientRequestState
refactoring
Posted by st...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
stakiar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
commit 85425b81f04c856d7d5ec375242303f78ec7964e
Author: Sahil Takiar <ta...@gmail.com>
AuthorDate: Wed Nov 13 21:13:53 2019 -0800
IMPALA-9124: ImpalaServer and ClientRequestState refactoring
Re-factoring several areas of the ImpalaServer and ClientRequestState
in preparation for future work required for transparent query retries.
Re-factored TExecRequest ownership in ClientRequestState. Previously,
the TExecRequest was passed to the ClientRequestState via the
Exec(TExecRequest) method. Now it is created and owned by the
ClientRequestState and only exposed as a constant reference. It is
stored as a plain member variable.
Re-factored ImpalaServer::UnregisterQuery into multiple methods. Made
ClientRequestStateMap a dedicated class that extends ShardedQueryMap
with additional methods to add and delete a ClientRequestState. The
re-factoring breaks up the large UnregisterQuery method into multiple
smaller method and adds some additional code documentation.
Re-factored ImpalaServer::client_request_state_map_ into a separate
class.
Testing:
* Ran core tests
Change-Id: Ib92c932a69802225af3fd9bf15f85c85317acaca
Reviewed-on: http://gerrit.cloudera.org:8080/14755
Reviewed-by: Sahil Takiar <st...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
be/src/service/client-request-state-map.h | 74 +++++++++++++++++++++++++++++++
be/src/service/client-request-state.cc | 22 +++++----
be/src/service/client-request-state.h | 31 ++++++++++---
be/src/service/impala-server.cc | 67 +++++++++++-----------------
be/src/service/impala-server.h | 20 ++++++---
5 files changed, 152 insertions(+), 62 deletions(-)
diff --git a/be/src/service/client-request-state-map.h b/be/src/service/client-request-state-map.h
new file mode 100644
index 0000000..20c5ccc
--- /dev/null
+++ b/be/src/service/client-request-state-map.h
@@ -0,0 +1,74 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you 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.
+
+#pragma once
+
+#include "gutil/strings/substitute.h"
+#include "util/sharded-query-map-util.h"
+
+namespace impala {
+
+class ClientRequestState;
+
+/// A ShardedQueryMap for ClientRequestStates. Maps a query_id to its corresponding
+/// ClientRequestState. Provides helper methods to easily add and delete
+/// ClientRequestStates from a ShardedQueryMap. The ClientRequestStates are non-const, so
+/// users of this class need to synchronize access to the ClientRequestStates either by
+/// creating a ScopedShardedMapRef or by locking on the ClientRequestState::lock().
+class ClientRequestStateMap
+ : public ShardedQueryMap<std::shared_ptr<ClientRequestState>> {
+ public:
+ /// Adds the given (query_id, request_state) pair to the map. Returns an error Status
+ /// if the query id already exists in the map.
+ Status AddClientRequestState(
+ const TUniqueId& query_id, std::shared_ptr<ClientRequestState> request_state) {
+ ScopedShardedMapRef<std::shared_ptr<ClientRequestState>> map_ref(query_id, this);
+ DCHECK(map_ref.get() != nullptr);
+
+ auto entry = map_ref->find(query_id);
+ if (entry != map_ref->end()) {
+ // There shouldn't be an active query with that same id.
+ // (query_id is globally unique)
+ return Status(ErrorMsg(TErrorCode::INTERNAL_ERROR,
+ strings::Substitute("query id $0 already exists", PrintId(query_id))));
+ }
+ map_ref->insert(make_pair(query_id, request_state));
+ return Status::OK();
+ }
+
+ /// Deletes the specified (query_id, request_state) pair from the map and sets the given
+ /// request_state pointer to the ClientRequestState associated with the given query_id.
+ /// If request_state == nullptr, it is not set. Returns an error Status if the query_id
+ /// cannot be found in the map.
+ Status DeleteClientRequestState(const TUniqueId& query_id,
+ std::shared_ptr<ClientRequestState>* request_state = nullptr) {
+ ScopedShardedMapRef<std::shared_ptr<ClientRequestState>> map_ref(query_id, this);
+ DCHECK(map_ref.get() != nullptr);
+ auto entry = map_ref->find(query_id);
+ if (entry == map_ref->end()) {
+ string error_msg =
+ strings::Substitute("Invalid or unknown query handle $0", PrintId(query_id));
+ VLOG(1) << error_msg;
+ return Status::Expected(error_msg);
+ } else if (request_state != nullptr) {
+ *request_state = entry->second;
+ }
+ map_ref->erase(entry);
+ return Status::OK();
+ }
+};
+}
diff --git a/be/src/service/client-request-state.cc b/be/src/service/client-request-state.cc
index 13bb433..8619060 100644
--- a/be/src/service/client-request-state.cc
+++ b/be/src/service/client-request-state.cc
@@ -177,9 +177,8 @@ void ClientRequestState::SetFrontendProfile(TRuntimeProfileNode profile) {
frontend_profile_->Update(prof_tree);
}
-Status ClientRequestState::Exec(TExecRequest* exec_request) {
+Status ClientRequestState::Exec() {
MarkActive();
- exec_request_ = *exec_request;
profile_->AddChild(server_profile_);
summary_profile_->AddInfoString("Query Type", PrintThriftEnum(stmt_type()));
@@ -188,7 +187,7 @@ Status ClientRequestState::Exec(TExecRequest* exec_request) {
summary_profile_->AddInfoString("Query Options (set by configuration and planner)",
DebugQueryOptions(exec_request_.query_options));
- switch (exec_request->stmt_type) {
+ switch (exec_request_.stmt_type) {
case TStmtType::QUERY:
case TStmtType::DML:
DCHECK(exec_request_.__isset.query_exec_request);
@@ -1115,19 +1114,19 @@ Status ClientRequestState::Cancel(bool check_inflight, const Status* cause) {
}
Status ClientRequestState::UpdateCatalog() {
- if (!exec_request().__isset.query_exec_request ||
- exec_request().query_exec_request.stmt_type != TStmtType::DML) {
+ if (!exec_request_.__isset.query_exec_request ||
+ exec_request_.query_exec_request.stmt_type != TStmtType::DML) {
return Status::OK();
}
query_events_->MarkEvent("DML data written");
SCOPED_TIMER(ADD_TIMER(server_profile_, "MetastoreUpdateTimer"));
- TQueryExecRequest query_exec_request = exec_request().query_exec_request;
+ TQueryExecRequest query_exec_request = exec_request_.query_exec_request;
if (query_exec_request.__isset.finalize_params) {
const TFinalizeParams& finalize_params = query_exec_request.finalize_params;
TUpdateCatalogRequest catalog_update;
- catalog_update.__set_sync_ddl(exec_request().query_options.sync_ddl);
+ catalog_update.__set_sync_ddl(exec_request_.query_options.sync_ddl);
catalog_update.__set_header(TCatalogServiceRequestHeader());
catalog_update.header.__set_requesting_user(effective_user());
catalog_update.header.__set_client_ip(session()->network_address.hostname);
@@ -1385,6 +1384,11 @@ bool ClientRequestState::GetDmlStats(TDmlResult* dml_result, Status* query_statu
return true;
}
+Status ClientRequestState::InitExecRequest(const TQueryCtx& query_ctx) {
+ return UpdateQueryStatus(
+ exec_env_->frontend()->GetExecRequest(query_ctx, &exec_request_));
+}
+
void ClientRequestState::UpdateEndTime() {
// Update the query's end time only if it isn't set previously.
if (end_time_us_.CompareAndSwap(0, UnixMicros())) {
@@ -1459,7 +1463,7 @@ void ClientRequestState::LogQueryEvents() {
}
Status ClientRequestState::LogAuditRecord(const Status& query_status) {
- const TExecRequest& request = exec_request();
+ const TExecRequest& request = exec_request_;
stringstream ss;
rapidjson::StringBuffer buffer;
rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
@@ -1535,7 +1539,7 @@ Status ClientRequestState::LogAuditRecord(const Status& query_status) {
}
Status ClientRequestState::LogLineageRecord() {
- const TExecRequest& request = exec_request();
+ const TExecRequest& request = exec_request_;
if (request.stmt_type == TStmtType::EXPLAIN || (!request.__isset.query_exec_request &&
!request.__isset.catalog_op_request)) {
return Status::OK();
diff --git a/be/src/service/client-request-state.h b/be/src/service/client-request-state.h
index 97ea18c..57f7a03 100644
--- a/be/src/service/client-request-state.h
+++ b/be/src/service/client-request-state.h
@@ -50,7 +50,7 @@ class TRuntimeProfileTree;
class TupleRow;
enum class AdmissionOutcome;
-/// Execution state of the client-facing side a query. This captures everything
+/// Execution state of the client-facing side of a query. This captures everything
/// necessary to convert row batches received by the coordinator into results
/// we can return to the client. It also captures all state required for
/// servicing query-related requests from the client.
@@ -73,12 +73,13 @@ class ClientRequestState {
/// which then sets the frontend profile.
void SetFrontendProfile(TRuntimeProfileNode profile);
- /// Based on query type, this either initiates execution of a exec_request or submits
- /// the query to the Admission controller for asynchronous admission control. When this
- /// returns the operation state is either RUNNING_STATE or PENDING_STATE.
+ /// Based on query type, this either initiates execution of this ClientRequestState's
+ /// TExecRequest or submits the query to the Admission controller for asynchronous
+ /// admission control. When this returns the operation state is either RUNNING_STATE or
+ /// PENDING_STATE.
/// Non-blocking.
/// Must *not* be called with lock_ held.
- Status Exec(TExecRequest* exec_request) WARN_UNUSED_RESULT;
+ Status Exec() WARN_UNUSED_RESULT;
/// Execute a HiveServer2 metadata operation
/// TODO: This is likely a superset of GetTableNames/GetDbs. Coalesce these different
@@ -184,6 +185,13 @@ class ClientRequestState {
/// Caller must not hold 'lock()'.
bool GetDmlStats(TDmlResult* dml_result, Status* query_status);
+ /// Creates and sets the TExecRequest for the query associated with this
+ /// ClientRequestState. The TExecRequest is created by the Impala frontend via the
+ /// method Frontend::GetExecRequest(TQueryCtx, TExecRequest). The TQueryCtx is created
+ /// by the ImpalaServer and contains the full query string
+ /// (TQueryCtx::TClientRequest::stmt).
+ Status InitExecRequest(const TQueryCtx& query_ctx);
+
ImpalaServer::SessionState* session() const { return session_.get(); }
/// Queries are run and authorized on behalf of the effective_user.
@@ -219,7 +227,12 @@ class ClientRequestState {
bool returns_result_set() { return !result_metadata_.columns.empty(); }
const TResultSetMetadata* result_metadata() const { return &result_metadata_; }
const TUniqueId& query_id() const { return query_ctx_.query_id; }
- const TExecRequest& exec_request() const { return exec_request_; }
+ /// Returns the TExecRequest for the query associated with this ClientRequestState.
+ /// Contents are only valid after InitExecRequest(TQueryCtx) initializes the
+ /// TExecRequest.
+ const TExecRequest& exec_request() const {
+ return exec_request_;
+ }
TStmtType::type stmt_type() const { return exec_request_.stmt_type; }
TCatalogOpType::type catalog_op_type() const {
return exec_request_.catalog_op_request.op_type;
@@ -452,7 +465,13 @@ protected:
apache::hive::service::cli::thrift::TOperationState::type operation_state_ =
apache::hive::service::cli::thrift::TOperationState::INITIALIZED_STATE;
+ /// The current status of the query tracked by this ClientRequestState. Updated by
+ /// UpdateQueryStatus(Status).
Status query_status_;
+
+ /// The TExecRequest for the query tracked by this ClientRequestState. The TExecRequest
+ /// is initialized in InitExecRequest(TQueryCtx). It should not be used until
+ /// InitExecRequest(TQueryCtx) has been called.
TExecRequest exec_request_;
/// If true, effective_user() has access to the runtime profile and execution
diff --git a/be/src/service/impala-server.cc b/be/src/service/impala-server.cc
index c79d708..76219be 100644
--- a/be/src/service/impala-server.cc
+++ b/be/src/service/impala-server.cc
@@ -907,12 +907,11 @@ Status ImpalaServer::ExecuteInternal(
DCHECK(session_state != nullptr);
*registered_request_state = false;
- request_state->reset(new ClientRequestState(query_ctx, exec_env_, exec_env_->frontend(),
- this, session_state));
+ request_state->reset(new ClientRequestState(
+ query_ctx, exec_env_, exec_env_->frontend(), this, session_state));
(*request_state)->query_events()->MarkEvent("Query submitted");
- TExecRequest result;
{
// Keep a lock on request_state so that registration and setting
// result_metadata are atomic.
@@ -940,9 +939,11 @@ Status ImpalaServer::ExecuteInternal(
statement_length, max_statement_length));
}
- RETURN_IF_ERROR((*request_state)->UpdateQueryStatus(
- exec_env_->frontend()->GetExecRequest(query_ctx, &result)));
+ // Takes the TQueryCtx and calls into the frontend to initialize the TExecRequest for
+ // this query.
+ RETURN_IF_ERROR((*request_state)->InitExecRequest(query_ctx));
+ const TExecRequest& result = (*request_state)->exec_request();
(*request_state)->query_events()->MarkEvent("Planning finished");
(*request_state)->set_user_profile_access(result.user_has_profile_access);
(*request_state)->summary_profile()->AddEventSequence(
@@ -952,10 +953,11 @@ Status ImpalaServer::ExecuteInternal(
(*request_state)->set_result_metadata(result.result_set_metadata);
}
}
- VLOG(2) << "Execution request: " << ThriftDebugString(result);
+ VLOG(2) << "Execution request: "
+ << ThriftDebugString((*request_state)->exec_request());
// start execution of query; also starts fragment status reports
- RETURN_IF_ERROR((*request_state)->Exec(&result));
+ RETURN_IF_ERROR((*request_state)->Exec());
Status status = UpdateCatalogMetrics();
if (!status.ok()) {
VLOG_QUERY << "Couldn't update catalog metrics: " << status.GetDetail();
@@ -1030,22 +1032,10 @@ Status ImpalaServer::RegisterQuery(shared_ptr<SessionState> session_state,
return Status::Expected("Session has been closed, ignoring query.");
}
const TUniqueId& query_id = request_state->query_id();
- {
- DCHECK_EQ(this, ExecEnv::GetInstance()->impala_server());
- ScopedShardedMapRef<std::shared_ptr<ClientRequestState>> map_ref(query_id,
- &client_request_state_map_);
- DCHECK(map_ref.get() != nullptr);
-
- auto entry = map_ref->find(query_id);
- if (entry != map_ref->end()) {
- // There shouldn't be an active query with that same id.
- // (query_id is globally unique)
- stringstream ss;
- ss << "query id " << PrintId(query_id) << " already exists";
- return Status(ErrorMsg(TErrorCode::INTERNAL_ERROR, ss.str()));
- }
- map_ref->insert(make_pair(query_id, request_state));
- }
+ DCHECK_EQ(this, ExecEnv::GetInstance()->impala_server());
+ RETURN_IF_ERROR(
+ client_request_state_map_.AddClientRequestState(query_id, request_state));
+
// Metric is decremented in UnregisterQuery().
ImpaladMetrics::NUM_QUERIES_REGISTERED->Increment(1L);
VLOG_QUERY << "Registered query query_id=" << PrintId(query_id)
@@ -1128,26 +1118,23 @@ void ImpalaServer::UpdateExecSummary(
Status ImpalaServer::UnregisterQuery(const TUniqueId& query_id, bool check_inflight,
const Status* cause) {
VLOG_QUERY << "UnregisterQuery(): query_id=" << PrintId(query_id);
-
+ // Cancel the query.
RETURN_IF_ERROR(CancelInternal(query_id, check_inflight, cause));
+ // Delete it from the client_request_state_map_ and from the http_handler_.
+ DCHECK_EQ(this, ExecEnv::GetInstance()->impala_server());
shared_ptr<ClientRequestState> request_state;
- {
- DCHECK_EQ(this, ExecEnv::GetInstance()->impala_server());
- ScopedShardedMapRef<std::shared_ptr<ClientRequestState>> map_ref(query_id,
- &client_request_state_map_);
- DCHECK(map_ref.get() != nullptr);
-
- auto entry = map_ref->find(query_id);
- if (entry == map_ref->end()) {
- VLOG(1) << "Invalid or unknown query handle " << PrintId(query_id);
- return Status::Expected("Invalid or unknown query handle");
- } else {
- request_state = entry->second;
- }
- map_ref->erase(entry);
- }
+ RETURN_IF_ERROR(
+ client_request_state_map_.DeleteClientRequestState(query_id, &request_state));
+
+ // Close and delete the ClientRequestState.
+ RETURN_IF_ERROR(CloseClientRequestState(request_state));
+
+ return Status::OK();
+}
+Status ImpalaServer::CloseClientRequestState(
+ const std::shared_ptr<ClientRequestState>& request_state) {
request_state->Done();
int64_t duration_us = request_state->end_time_us() - request_state->start_time_us();
@@ -1163,7 +1150,7 @@ Status ImpalaServer::UnregisterQuery(const TUniqueId& query_id, bool check_infli
}
{
lock_guard<mutex> l(request_state->session()->lock);
- request_state->session()->inflight_queries.erase(query_id);
+ request_state->session()->inflight_queries.erase(request_state->query_id());
}
if (request_state->GetCoordinator() != nullptr) {
diff --git a/be/src/service/impala-server.h b/be/src/service/impala-server.h
index a05bddc..7e78532 100644
--- a/be/src/service/impala-server.h
+++ b/be/src/service/impala-server.h
@@ -39,12 +39,12 @@
#include "runtime/timestamp-value.h"
#include "runtime/types.h"
#include "scheduling/query-schedule.h"
+#include "service/client-request-state-map.h"
#include "service/query-options.h"
#include "statestore/statestore-subscriber.h"
#include "util/condition-variable.h"
#include "util/container-util.h"
#include "util/runtime-profile.h"
-#include "util/sharded-query-map-util.h"
#include "util/simple-logger.h"
#include "util/thread-pool.h"
#include "util/time.h"
@@ -696,12 +696,19 @@ class ImpalaServer : public ImpalaServiceIf,
/// Unregister the query by cancelling it, removing exec_state from
/// client_request_state_map_, and removing the query id from session state's
- /// in-flight query list. If check_inflight is true, then return an error if the query
- /// is not yet in-flight. Otherwise, proceed even if the query isn't yet in-flight (for
+ /// in-flight query list. If check_inflight is true, then return an error if the query
+ /// is not yet in-flight. Otherwise, proceed even if the query isn't yet in-flight (for
/// cleaning up after an error on the query issuing path).
Status UnregisterQuery(const TUniqueId& query_id, bool check_inflight,
const Status* cause = NULL) WARN_UNUSED_RESULT;
+ /// Performs any final cleanup necessary before the given ClientRequestState goes out
+ /// of scope and is deleted. Marks the given ClientRequestState as done, removes the
+ /// query from the inflight queries list, updates query_locations_, and archives the
+ /// query. Used when unregistering the query.
+ Status CloseClientRequestState(
+ const std::shared_ptr<ClientRequestState>& request_state);
+
/// Initiates query cancellation reporting the given cause as the query status.
/// Assumes deliberate cancellation by the user if the cause is NULL. Returns an
/// error if query_id is not found. If check_inflight is true, then return an error
@@ -1080,10 +1087,9 @@ class ImpalaServer : public ImpalaServiceIf,
/// Thread that runs UnresponsiveBackendThread().
std::unique_ptr<Thread> unresponsive_backend_thread_;
- /// maps from query id to exec state; ClientRequestState is owned by us and referenced
- /// as a shared_ptr to allow asynchronous deletion
- typedef class ShardedQueryMap<std::shared_ptr<ClientRequestState>>
- ClientRequestStateMap;
+ /// A ClientRequestStateMap maps query ids to ClientRequestStates. The
+ /// ClientRequestStates are owned by the ImpalaServer and ClientRequestStateMap
+ /// references them using shared_ptr to allow asynchronous deletion.
ClientRequestStateMap client_request_state_map_;
/// Default query options in the form of TQueryOptions and beeswax::ConfigVariable
[impala] 01/03: IMPALA-9219: [DOCS] ISO-SQL 2016 Date/time format
patters - Milestone 3
Posted by st...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
stakiar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
commit f608be7d02813d458deee59f9b102c6f29778dbc
Author: Alex Rodoni <ar...@cloudera.com>
AuthorDate: Thu Dec 5 16:04:04 2019 -0800
IMPALA-9219: [DOCS] ISO-SQL 2016 Date/time format patters - Milestone 3
The following patters are documented:
MONTH, MON, DAY, DY, D, Q, WW, W
Also added boundaries for TZH and TZM (IMPALA-9217).
Change-Id: If0586445c13cc6d02548be4cca43014066e0d99b
Reviewed-on: http://gerrit.cloudera.org:8080/14861
Tested-by: Impala Public Jenkins <im...@cloudera.com>
Reviewed-by: Alex Rodoni <ar...@cloudera.com>
---
docs/topics/impala_conversion_functions.xml | 1128 ++++++++++++++++++++-------
1 file changed, 832 insertions(+), 296 deletions(-)
diff --git a/docs/topics/impala_conversion_functions.xml b/docs/topics/impala_conversion_functions.xml
index 52c9371..57cdc17 100644
--- a/docs/topics/impala_conversion_functions.xml
+++ b/docs/topics/impala_conversion_functions.xml
@@ -158,42 +158,51 @@ under the License.
<dd>
<b>Purpose:</b> Returns <varname>expression</varname> converted to the
- <varname>type</varname> data type based on the
- <varname>pattern</varname> format string. This signature of
- <codeph>CAST()</codeph> with the <codeph>FORMAT</codeph> clause is
- supported only for casts between <codeph>STRING</codeph> /
- <codeph>CHAR</codeph> / <codeph>VARCHAR</codeph> types and
- <codeph>TIMESTAMP</codeph> / <codeph>DATE</codeph> types. <note> The
- patterns allowed in the <codeph>FORMAT</codeph> clause support ISO
- SQL:2016 standard patterns. Those patterns are not the same format
- patterns used with the other Impala conversion functions, e.g.
- <codeph>TO_TIMESTAMP()</codeph> and
- <codeph>FROM_TIMESTAMP()</codeph>. </note>
- <p> The following rules apply to <varname>pattern</varname>. Any
- exceptions to these rules are noted in the Details column of the
- table below. <ul>
+ <varname>type</varname> data type based on the <varname>pattern</varname> format
+ string. This signature of <codeph>CAST()</codeph> with the <codeph>FORMAT</codeph>
+ clause is supported only for casts between <codeph>STRING</codeph> /
+ <codeph>CHAR</codeph> / <codeph>VARCHAR</codeph> types and <codeph>TIMESTAMP</codeph>
+ / <codeph>DATE</codeph> types.
+ <note>
+ The patterns allowed in the <codeph>FORMAT</codeph> clause support ISO SQL:2016
+ standard patterns. Those patterns are not the same format patterns used with the
+ other Impala conversion functions, e.g. <codeph>TO_TIMESTAMP()</codeph> and
+ <codeph>FROM_TIMESTAMP()</codeph>.
+ </note>
+
+ <p>
+ The following rules apply to <varname>pattern</varname>. Any exceptions to these
+ rules are noted in the Details column of the table below.
+ <ul>
+ <li>
+ <varname>pattern</varname> is a case-insensitive <codeph>STRING</codeph> unless
+ noted otherwise in the table below.
+ </li>
+
<li>
- <varname>pattern</varname> is a case-insensitive
- <codeph>STRING</codeph>. </li>
- <li> If <varname>pattern</varname> is <codeph>NULL</codeph>, an
- empty string, or a number, an error returns. </li>
- <li> A fewer digits in <varname>expression</varname> than
- specified in the <varname>pattern</varname> is accepted if a
- separator is correctly specified in the
- <varname>pattern</varname>. For example,
- <codeph>CAST('5-01-2017' AS DATE FORMAT 'MM-dd-yyyy')</codeph>
- returns <codeph>DATE'2017-05-01'</codeph>. </li>
- <li> If fewer number of digits are in
- <varname>expression</varname> than specified in the
- <varname>pattern</varname>, the current date is used to
- complete the year pattern. For example, <codeph>CAST('19/05' AS
- DATE FORMAT 'YYYY/MM')</codeph> will return
- <codeph>DATE'2019-05-01'</codeph> when executed on August 8,
- 2019. </li>
+ If <varname>pattern</varname> is <codeph>NULL</codeph>, an empty string, or a
+ number, an error returns.
+ </li>
+
+ <li>
+ A fewer digits in <varname>expression</varname> than specified in the
+ <varname>pattern</varname> is accepted if a separator is correctly specified in
+ the <varname>pattern</varname>. For example, <codeph>CAST('5-01-2017' AS DATE
+ FORMAT 'MM-dd-yyyy')</codeph> returns <codeph>DATE'2017-05-01'</codeph>.
+ </li>
+
+ <li>
+ If fewer number of digits are in <varname>expression</varname> than specified in
+ the <varname>pattern</varname>, the current date is used to complete the year
+ pattern. For example, <codeph>CAST('19/05' AS DATE FORMAT 'YYYY/MM')</codeph>
+ will return <codeph>DATE'2019-05-01'</codeph> when executed on August 8, 2019.
+ </li>
</ul>
</p>
- <p> The following format patterns are supported in the
- <codeph>FORMAT</codeph> clause. <table frame="all" rowsep="1"
+
+ <p>
+ The following format patterns are supported in the <codeph>FORMAT</codeph> clause.
+ <table frame="all" rowsep="1"
colsep="1" id="table_gbt_5ym_r3b">
<tgroup cols="3" align="left">
<colspec colname="c1" colnum="1" colwidth="1*"/>
@@ -201,9 +210,15 @@ under the License.
<colspec colname="newCol3" colnum="3" colwidth="6.6*"/>
<thead>
<row>
- <entry> Pattern </entry>
- <entry> Description </entry>
- <entry> Details </entry>
+ <entry>
+ Pattern
+ </entry>
+ <entry>
+ Description
+ </entry>
+ <entry>
+ Details
+ </entry>
</row>
</thead>
<tbody>
@@ -211,314 +226,716 @@ under the License.
<entry>
<codeph>YYYY</codeph>
</entry>
- <entry> 4-digit year. </entry>
+ <entry>
+ 4-digit year.
+ </entry>
<entry/>
</row>
<row>
<entry>
<codeph>YYY</codeph>
</entry>
- <entry> Last 3 digits of a year. </entry>
+ <entry>
+ Last 3 digits of a year.
+ </entry>
<entry/>
</row>
<row>
<entry>
<codeph>YY</codeph>
</entry>
- <entry> Last 2 digits of a year. </entry>
+ <entry>
+ Last 2 digits of a year.
+ </entry>
<entry/>
</row>
<row>
<entry>
<codeph>Y</codeph>
</entry>
- <entry> Last digit of a year </entry>
+ <entry>
+ Last digit of a year
+ </entry>
<entry/>
</row>
<row>
<entry>
<codeph>RRRR</codeph>
</entry>
- <entry> 4-digit round year </entry>
<entry>
- <p> If 1,3 or 4-digit year values are provided in
- <varname>expression</varname>, treated as
- <codeph>YYYY</codeph>. </p>
- <p> If 2-digit years are provided in
- <varname>expression</varname>, treated as
- <codeph>RR</codeph>. </p>
- <p> For date/time to string conversions, treated as
- <codeph>YYYY</codeph>. </p>
- <p> If <codeph>YYYY</codeph>, <codeph>YYY</codeph>,
- <codeph>YY</codeph>, <codeph>Y</codeph>, or
- <codeph>RR</codeph> is given in the same
- <varname>pattern</varname> for a string to date/time
- conversion, an error returns. </p>
+ 4-digit round year
+ </entry>
+ <entry>
+ <p>
+ If 1,3 or 4-digit year values are provided in
+ <varname>expression</varname>, treated as <codeph>YYYY</codeph>.
+ </p>
+
+
+
+ <p>
+ If 2-digit years are provided in <varname>expression</varname>, treated
+ as <codeph>RR</codeph>.
+ </p>
+
+
+
+ <p>
+ For date/time to string conversions, treated as <codeph>YYYY</codeph>.
+ </p>
+
+
+
+ <p>
+ If <codeph>YYYY</codeph>, <codeph>YYY</codeph>, <codeph>YY</codeph>,
+ <codeph>Y</codeph>, or <codeph>RR</codeph> is given in the same
+ <varname>pattern</varname> for a string to date/time conversion, an
+ error returns.
+ </p>
</entry>
</row>
<row>
<entry>
<codeph>RR</codeph>
</entry>
- <entry> 2-digit round year. </entry>
<entry>
- <p>For date/time to string conversions, same as
- <codeph>YY</codeph>. </p>
- <p>For string to date/time conversions, the first 2 digits
- of the year in the return value depends on the specified
- two-digit year and the last two digits of the current
- year as follows: <ul>
+ 2-digit round year.
+ </entry>
+ <entry>
+ <p>
+ For date/time to string conversions, same as <codeph>YY</codeph>.
+ </p>
+
+
+
+ <p>
+ For string to date/time conversions, the first 2 digits of the year in
+ the return value depends on the specified two-digit year and the last
+ two digits of the current year as follows:
+ <ul>
<li>
- <p> If the specified 2-digit year is 00 to 49: </p>
+ <p>
+ If the specified 2-digit year is 00 to 49:
+ </p>
<ul>
<li>
- <p> If the last 2 digits of the current year are
- 00 to 49, the returned year has the same first
- 2 digits as the current year. </p>
+ <p>
+ If the last 2 digits of the current year are 00 to 49, the
+ returned year has the same first 2 digits as the current year.
+ </p>
</li>
+
<li>
- <p> If the last 2 digits of the current year are
- 50 to 99, the first 2 digits of the returned
- year are 1 greater than the first 2 digits of
- the current year. </p>
+ <p>
+ If the last 2 digits of the current year are 50 to 99, the
+ first 2 digits of the returned year are 1 greater than the
+ first 2 digits of the current year.
+ </p>
</li>
</ul>
</li>
+
<li>
- <p> If the specified 2-digit year is 50 to 99: </p>
+ <p>
+ If the specified 2-digit year is 50 to 99:
+ </p>
<ul>
<li>
- <p> If the last 2 digits of the current year are
- 00 to 49, the first 2 digits of the returned
- year are 1 less than the first 2 digits of the
- current year. </p>
+ <p>
+ If the last 2 digits of the current year are 00 to 49, the
+ first 2 digits of the returned year are 1 less than the first
+ 2 digits of the current year.
+ </p>
</li>
+
<li>
- <p> If the last 2 digits of the current year are
- 50 to 99, the returned year has the same first
- 2 digits as the current year. </p>
+ <p>
+ If the last 2 digits of the current year are 50 to 99, the
+ returned year has the same first 2 digits as the current year.
+ </p>
</li>
</ul>
</li>
- </ul></p>
- <p> If <codeph>YYYY</codeph>, <codeph>YYY</codeph>,
- <codeph>YY</codeph>, <codeph>Y</codeph>, or
- <codeph>RR</codeph> is given in the same
- <varname>pattern</varname> for a string to date/time
- conversion, an error returns. </p>
- <p> If 1-digit year values are provided in
- <varname>expression</varname>, it is treated as
- <codeph>YYYY</codeph>. </p>
+ </ul>
+ </p>
+
+
+
+ <p>
+ If <codeph>YYYY</codeph>, <codeph>YYY</codeph>, <codeph>YY</codeph>,
+ <codeph>Y</codeph>, or <codeph>RR</codeph> is given in the same
+ <varname>pattern</varname> for a string to date/time conversion, an
+ error returns.
+ </p>
+
+
+
+ <p>
+ If 1-digit year values are provided in <varname>expression</varname>, it
+ is treated as <codeph>YYYY</codeph>.
+ </p>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <codeph>Q</codeph>
+ </entry>
+ <entry>
+ Quarter of year (1-4)
+ </entry>
+ <entry>
+ <p>
+ Not supported in string to date/time conversions.
+ </p>
</entry>
</row>
<row>
<entry>
<codeph>MM</codeph>
</entry>
- <entry> Month </entry>
<entry>
- <p> In date/time to string conversions, 1-digit month is
- prefixed with a zero. </p>
+ Month number
+ </entry>
+ <entry>
+ <p>
+ In date/time to string conversions, a 1-digit month is prefixed with a
+ zero.
+ </p>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <codeph>MONTH</codeph>
+
+ <p>
+ <codeph>Month</codeph>
+ </p>
+
+
+
+ <p>
+ <codeph>month</codeph>
+ </p>
+ </entry>
+ <entry>
+ Full month name
+ </entry>
+ <entry>
+ In string to date/time conversions:
+
+ <ul>
+ <li>
+ Converts textual month names to 2-digit month numbers.
+ </li>
+
+ <li>
+ The input strings are expected without trailing spaces, e.g.
+ "<codeph>June</codeph>", "<codeph>August</codeph>".
+ </li>
+
+ <li>
+ If the <codeph>FX</codeph> modifier is active for the token, a
+ 9-character-long full month name with trailing spaces is expected for
+ the input string.
+ </li>
+ </ul>
+
+ <p>
+ In date/time to string conversions:
+ <ul>
+ <li>
+ Converts to a 9-character-long full month name with trailing spaces.
+ </li>
+
+ <li>
+ If the <codeph>FM</codeph> modifier is active for this token,
+ converts to a month name without trailing spaces.
+ </li>
+ </ul>
+ </p>
+
+
+
+ <p>
+ This pattern token is case sensitive. <codeph>MONTH</codeph>,
+ <codeph>Month</codeph>, <codeph>month</codeph> would require different
+ casing of the input in string to date/time conversions and would produce
+ cased outputs in date/time to string conversions, For example,
+ <codeph>MONTH</codeph>, <codeph>Month</codeph>, <codeph>month</codeph>
+ would convert respectively <codeph>JULY</codeph>, <codeph>July</codeph>,
+ and <codeph>july</codeph>.
+ </p>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <codeph>MON</codeph>
+
+ <p>
+ <codeph>Mon</codeph>
+ </p>
+
+
+
+ <p>
+ <codeph>mon</codeph>
+ </p>
+ </entry>
+ <entry>
+ Abbreviated 3-character month name
+ </entry>
+ <entry>
+ <p>
+ This pattern token is case sensitive. <codeph>MON</codeph>,
+ <codeph>Mon</codeph>, <codeph>mon</codeph> would require different
+ casing of the input in string to date/time conversions and would produce
+ cased outputs in date/time to string conversions, For example,
+ <codeph>MON</codeph>, <codeph>Mon</codeph>, <codeph>mon</codeph> would
+ convert respectively <codeph>JUL</codeph>, <codeph>Jul</codeph>, and
+ <codeph>jul</codeph>.
+ </p>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <codeph>WW</codeph>
+ </entry>
+ <entry>
+ Week of year (1-53)
+ </entry>
+ <entry>
+ <p>
+ Not supported in a string to date/time conversions.
+ </p>
+
+
+
+ <p>
+ 1st week begins on January 1st and ends on January 7th.
+ </p>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <codeph>W</codeph>
+ </entry>
+ <entry>
+ Week of month (1-5)
+ </entry>
+ <entry>
+ <p>
+ Not supported in string to date/time conversions.
+ </p>
+
+
+
+ <p>
+ 1st week begins on the 1st of the month and ends on the 7th.
+ </p>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <codeph>D</codeph>
+ </entry>
+ <entry>
+ Day of week (1-7)
+ </entry>
+ <entry>
+ <p>
+ Not supported in string to date/time conversions.
+ </p>
+
+ In date/time to string conversions, converts to a day number, for example,
+ 1 for Sunday, 2 for Monday.
</entry>
</row>
<row>
<entry>
<codeph>DD</codeph>
</entry>
- <entry> Day of month (1-31) </entry>
<entry>
- <p> In date/time to string conversions, one digit day is
- prefixed with a zero. </p>
+ Day of month (1-31)
+ </entry>
+ <entry>
+ <p>
+ In date/time to string conversions, one digit day is prefixed with a
+ zero.
+ </p>
</entry>
</row>
<row>
<entry>
<codeph>DDD</codeph>
</entry>
- <entry> Day of year (1-366) </entry>
<entry>
- <p> In string to date/time conversions, providing
- <codeph>MM</codeph> and <codeph>DD</codeph> along with
- <codeph>DDD</codeph> results an error, e.g.
- <codeph>YYYY-MM-DDD</codeph>. </p>
+ Day of year (1-366)
+ </entry>
+ <entry>
+ <p>
+ In string to date/time conversions, providing <codeph>MM</codeph> and
+ <codeph>DD</codeph> along with <codeph>DDD</codeph> results an error,
+ e.g. <codeph>YYYY-MM-DDD</codeph>.
+ </p>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <codeph>DAY</codeph>
+
+ <p>
+ <codeph>Day</codeph>
+ </p>
+
+
+
+ <p>
+ <codeph>day</codeph>
+ </p>
+ </entry>
+ <entry>
+ Day name
+ </entry>
+ <entry>
+ <p>
+ Not supported in string to date/time conversions.
+ </p>
+
+
+
+ <p>
+ In date/time to string conversions:
+ <ul>
+ <li>
+ Converts to a 9-character-long full day name with trailing spaces.
+ </li>
+
+ <li>
+ If the <codeph>FM</codeph> modifier is active for this token,
+ converts to a day name without trailing spaces.
+ </li>
+ </ul>
+ </p>
+
+
+
+ <p>
+ This pattern token is case sensitive. <codeph>DAY</codeph>,
+ <codeph>Day</codeph>, <codeph>day</codeph> would produce cased outputs
+ in date/time to string conversions, For example, <codeph>DAY</codeph>,
+ <codeph>Day</codeph>, <codeph>day</codeph> would convert respectively
+ <codeph>MONDAY</codeph>, <codeph>Monday</codeph>, and
+ <codeph>monday</codeph>.
+ </p>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <codeph>DY</codeph>
+
+ <p>
+ <codeph>Dy</codeph>
+ </p>
+
+
+
+ <p>
+ <codeph>dy</codeph>
+ </p>
+ </entry>
+ <entry>
+ Abbreviated 3-character day name
+ </entry>
+ <entry>
+ <p>
+ Not supported in string to date/time conversions.
+ </p>
+
+
+
+ <p>
+ This pattern token is case sensitive. <codeph>DY</codeph>,
+ <codeph>Dy</codeph>, <codeph>dy</codeph> would produce cased outputs in
+ date/time to string conversions, For example, <codeph>DY</codeph>,
+ <codeph>Dy</codeph>, <codeph>dy</codeph> would convert respectively
+ <codeph>MON</codeph>, <codeph>Mon</codeph>, and <codeph>mon</codeph>.
+ </p>
</entry>
</row>
<row>
<entry>
<codeph>HH</codeph>
+
<p>
<codeph>HH12</codeph>
</p>
</entry>
- <entry> Hour of day (1-12) </entry>
<entry>
- <p> In date/time to string conversions, 1-digit hours are
- prefixed with a zero. </p>
- <p> If provided hour in <varname>expression</varname> is
- not between 1 and 12, returns an error. </p>
- <p> If no AM/PM is provided in
- <varname>expression</varname>, the default is
- <codeph>AM</codeph>. </p>
+ Hour of day (1-12)
+ </entry>
+ <entry>
+ <p>
+ In date/time to string conversions, 1-digit hours are prefixed with a
+ zero.
+ </p>
+
+
+
+ <p>
+ If provided hour in <varname>expression</varname> is not between 1 and
+ 12, returns an error.
+ </p>
+
+
+
+ <p>
+ If no AM/PM is provided in <varname>expression</varname>, the default is
+ <codeph>AM</codeph>.
+ </p>
</entry>
</row>
<row>
<entry>
<codeph>HH24</codeph>
</entry>
- <entry> Hour of day (0-23) </entry>
<entry>
- <p> In string to date/time conversions, if
- <codeph>HH12</codeph>, <codeph>AM</codeph>,
- <codeph>PM</codeph> are given in the same
- <varname>pattern</varname>, an error returns. </p>
+ Hour of day (0-23)
+ </entry>
+ <entry>
+ <p>
+ In string to date/time conversions, if <codeph>HH12</codeph>,
+ <codeph>AM</codeph>, <codeph>PM</codeph> are given in the same
+ <varname>pattern</varname>, an error returns.
+ </p>
</entry>
</row>
<row>
<entry>
<codeph>MI</codeph>
</entry>
- <entry> Minute of hour (0-59) </entry>
<entry>
- <p> In date/time to string conversions, 1-digit minutes
- are prefixed with a zero. </p>
+ Minute of hour (0-59)
+ </entry>
+ <entry>
+ <p>
+ In date/time to string conversions, 1-digit minutes are prefixed with a
+ zero.
+ </p>
</entry>
</row>
<row>
<entry>
<codeph>SS</codeph>
</entry>
- <entry> Second of minute (0-59) </entry>
<entry>
- <p> In date/time to string conversions, 1-digit seconds
- are prefixed with a zero. </p>
+ Second of minute (0-59)
+ </entry>
+ <entry>
+ <p>
+ In date/time to string conversions, 1-digit seconds are prefixed with a
+ zero.
+ </p>
</entry>
</row>
<row>
<entry>
<codeph>SSSSS</codeph>
</entry>
- <entry> Second of Day (0-86399) </entry>
<entry>
- <p> In string to timestamp conversions, if
- <codeph>SS</codeph>, <codeph>HH</codeph>,
- <codeph>HH12</codeph>, <codeph>HH24</codeph>,
- <codeph>MI</codeph>,
- <codeph>AM</codeph>/<codeph>PM</codeph> are given in
- the same <varname>pattern</varname>, an error returns.
+ Second of Day (0-86399)
+ </entry>
+ <entry>
+ <p>
+ In string to timestamp conversions, if <codeph>SS</codeph>,
+ <codeph>HH</codeph>, <codeph>HH12</codeph>, <codeph>HH24</codeph>,
+ <codeph>MI</codeph>, <codeph>AM</codeph>/<codeph>PM</codeph> are given
+ in the same <varname>pattern</varname>, an error returns.
</p>
</entry>
</row>
<row>
<entry>
<codeph>FF</codeph>
+
<p>
<codeph>FF1</codeph>, ..., <codeph>FF9</codeph>
</p>
</entry>
- <entry> Fractional second </entry>
<entry>
- <p> A number, 1 to 9, can be used to indicate the number
- of digits. </p>
+ Fractional second
+ </entry>
+ <entry>
+ <p>
+ A number, 1 to 9, can be used to indicate the number of digits.
+ </p>
+
+
+
<p>
- <codeph>FF</codeph> specifies a 9 digits fractional
- second. </p>
+ <codeph>FF</codeph> specifies a 9 digits fractional second.
+ </p>
</entry>
</row>
<row>
<entry>
<codeph>AM</codeph>
+
<p>
<codeph>PM</codeph>
</p>
+
+
+
<p>
<codeph>A.M.</codeph>
</p>
+
+
+
<p>
<codeph>P.M.</codeph>
</p>
</entry>
- <entry> Meridiem indicator </entry>
<entry>
- <p> For date/time to string conversions,
- <codeph>AM</codeph> and <codeph>PM</codeph> are
- treated as synonyms. For example, casting
- <codeph>'2019-01-01 11:00 am'</codeph> to
- <codeph>TIMESTAMP</codeph> with the
- <codeph>'YYYY-MM-DD HH12:MI PM'</codeph> pattern
- returns <codeph>01-JAN-19 11.00.00.000000 AM</codeph>. </p>
- <p> For string to date/time conversion,
- <codeph>HH24</codeph> in the same
- <varname>pattern</varname> returns an error. </p>
+ Meridiem indicator
+ </entry>
+ <entry>
+ <p>
+ For date/time to string conversions, <codeph>AM</codeph> and
+ <codeph>PM</codeph> are treated as synonyms. For example, casting
+ <codeph>'2019-01-01 11:00 am'</codeph> to <codeph>TIMESTAMP</codeph>
+ with the <codeph>'YYYY-MM-DD HH12:MI PM'</codeph> pattern returns
+ <codeph>01-JAN-19 11.00.00.000000 AM</codeph>.
+ </p>
+
+
+
+ <p>
+ For string to date/time conversion, <codeph>HH24</codeph> in the same
+ <varname>pattern</varname> returns an error.
+ </p>
</entry>
</row>
<row>
<entry>
<codeph>TZH</codeph>
</entry>
- <entry> Timezone offset hour </entry>
<entry>
- <p> An optional sign, + or -, and 2 digits for the value
- of signed numbers are allowed for the source
- <varname>expression</varname>, e.g.
- <codeph>“+10”</codeph>, <codeph>“-05”</codeph>,
- <codeph>"04"</codeph>. </p>
+ Timezone offset hour
+ </entry>
+ <entry>
+ <p>
+ An optional sign, + or -, and 2 digits for the value of signed numbers
+ are allowed for the source <varname>expression</varname>, e.g.
+ <codeph>+10</codeph>, <codeph>-05</codeph>, <codeph>04</codeph>.
+ </p>
+
+
+
+ <p>
+ The allowed values are from <codeph>-15</codeph> to <codeph>+5</codeph>.
+ </p>
</entry>
</row>
<row>
<entry>
<codeph>TZM</codeph>
</entry>
- <entry> Timezone offset minute </entry>
<entry>
- <p> Unsigned numbers are allowed for the source
- <varname>expression</varname>. </p>
+ Timezone offset minute
+ </entry>
+ <entry>
+ <p>
+ Unsigned numbers are allowed for the source
+ <varname>expression</varname>.
+ </p>
+
+
+
+ <p>
+ The allowed values are from <codeph>0</codeph> to <codeph>59</codeph>.
+ </p>
</entry>
</row>
<row>
<entry>
<codeph>-</codeph>
+
<p>
<codeph>.</codeph>
</p>
+
+
+
<p>
<codeph>/</codeph>
</p>
+
+
+
<p>
<codeph>,</codeph>
</p>
+
+
+
<p>
<codeph>'</codeph>
</p>
+
+
+
<p>
<codeph>;</codeph>
</p>
+
+
+
<p>
<codeph>:</codeph>
</p>
- <p> <space> </p>
+
+
+
+ <p>
+ <space>
+ </p>
</entry>
- <entry> Separator </entry>
<entry>
- <p> For string to date/time conversions, any separator
- character in the <varname>pattern</varname> string would
- match any separator character in the input
- <varname>expression</varname>. </p>
- <p> For example, <codeph>CAST(“20191010” AS DATE FORMAT
- “YYYY-MM-DD”)</codeph> returns an error, but
- <codeph>CAST("2019-.;10 10" AS DATE FORMAT
- "YYYY-MM-DD")</codeph> succeeds. </p>
+ Separator
+ </entry>
+ <entry>
+ <p>
+ For string to date/time conversions, any separator character in the
+ <varname>pattern</varname> string would match any separator character in
+ the input <varname>expression</varname>.
+ </p>
+
+
+
+ <p>
+ For example, <codeph>CAST(“20191010” AS DATE FORMAT
+ “YYYY-MM-DD”)</codeph> returns an error, but <codeph>CAST("2019-.;10
+ 10" AS DATE FORMAT "YYYY-MM-DD")</codeph> succeeds.
+ </p>
</entry>
</row>
<row>
<entry>
<codeph>T</codeph>
</entry>
- <entry> Separates the date from the time. </entry>
<entry>
- <p>This pattern is used for accepting ISO 8601 date/time
- formats. </p>
- <p> Example:
- <codeph>YYYY-MM-DD<b>T</b>HH24:MI:SS.FF9Z</codeph>
+ Separates the date from the time.
+ </entry>
+ <entry>
+ <p>
+ This pattern is used for accepting ISO 8601 date/time formats.
+ </p>
+
+
+
+ <p>
+ Example: <codeph>YYYY-MM-DD<b>T</b>HH24:MI:SS.FF9Z</codeph>
</p>
</entry>
</row>
@@ -526,258 +943,377 @@ under the License.
<entry>
<codeph>Z</codeph>
</entry>
- <entry> Indicates the zero hour offset from UTC. </entry>
<entry>
- <p>This pattern is used for accepting ISO 8601 date/time
- formats. </p>
+ Indicates the zero hour offset from UTC.
+ </entry>
+ <entry>
+ <p>
+ This pattern is used for accepting ISO 8601 date/time formats.
+ </p>
</entry>
</row>
<row>
- <entry><codeph>FX</codeph></entry>
- <entry>Forces an exact match between the format pattern,
- <varname>pattern</varname>, and the input argument,
- <varname>expression</varname>.</entry>
<entry>
- <p>Must be specified at the beginning of the format
- <varname>pattern</varname> and is valid for the whole
- <varname>pattern</varname>.</p>
- <p> In string to date/time conversions:</p>
+ <codeph>FX</codeph>
+ </entry>
+ <entry>
+ Forces an exact match between the format pattern,
+ <varname>pattern</varname>, and the input argument,
+ <varname>expression</varname>.
+ </entry>
+ <entry>
+ <p>
+ Must be specified at the beginning of the format
+ <varname>pattern</varname> and is valid for the whole
+ <varname>pattern</varname>.
+ </p>
+
+
+
+ <p>
+ In string to date/time conversions:
+ </p>
+
<ul>
- <li>Forces strict separator matching, including the
- separator character.</li>
- <li>Expects all the tokens to have the maximum possible
- length.</li>
+ <li>
+ Forces strict separator matching, including the separator character.
+ </li>
+
+ <li>
+ Expects all the tokens to have the maximum possible length.
+ </li>
</ul>
- <p>In date/time to string conversions, the outputs are
- padded as follows:</p>
+
+ <p>
+ In date/time to string conversions, the outputs are padded as follows:
+ </p>
+
<ul>
- <li>Numeric outputs are left padded with zeros.</li>
- <li>Text outputs are right padded with spaces.</li>
+ <li>
+ Numeric outputs are left padded with zeros.
+ </li>
+
+ <li>
+ Text outputs are right padded with spaces.
+ </li>
</ul>
</entry>
</row>
<row>
- <entry><codeph>FM</codeph></entry>
- <entry>Overrides <codeph>FX</codeph>.</entry>
<entry>
- <p>In a date/time to string conversions,
- <codeph>FM</codeph> suppresses blank padding for the
- element immediately following the <codeph>FM</codeph> in
- the <varname>pattern</varname> string, e.g.
- "<codeph>2010-1-9</codeph>".</p>
- <p>In string to date/time conversions, <codeph>FM</codeph>
- is used to override the effect of <codeph>FX</codeph>
- for certain tokens as follows:<ul>
+ <codeph>FM</codeph>
+ </entry>
+ <entry>
+ Overrides <codeph>FX</codeph>.
+ </entry>
+ <entry>
+ <p>
+ In a date/time to string conversions, <codeph>FM</codeph> suppresses
+ blank padding for the element immediately following the
+ <codeph>FM</codeph> in the <varname>pattern</varname> string, e.g.
+ "<codeph>2010-1-9</codeph>".
+ </p>
+
+
+
+ <p>
+ In string to date/time conversions, <codeph>FM</codeph> is used to
+ override the effect of <codeph>FX</codeph> for certain tokens as
+ follows:
+ <ul>
<li>
- <p>The length of the token in the input argument can
- be shorter than the max length of that token type
- if followed by a separator, e.g. 1-digit month,
- less than 4-digit year.</p>
+ <p>
+ The length of the token in the input argument can be shorter than
+ the max length of that token type if followed by a separator, e.g.
+ 1-digit month, less than 4-digit year.
+ </p>
</li>
+
<li>
- <p><codeph>FM</codeph> modifier skips the separators
- and affects the next non-separator token. For
- example, <codeph>CAST('1999-10-2' AS TIMESTAMP
- FORMAT 'FXYYYY-MM<b>FM</b>-DD') </codeph>returns
- <codeph>1999-10-02 00:00:00</codeph> as
- <codeph>FM</codeph> is applied to
- <codeph>DD</codeph> and not to the
- separator(<codeph>-</codeph>).</p>
+ <p>
+ <codeph>FM</codeph> modifier skips the separators and affects the
+ next non-separator token. For example, <codeph>CAST('1999-10-2' AS
+ TIMESTAMP FORMAT 'FXYYYY-MM<b>FM</b>-DD') </codeph>returns
+ <codeph>1999-10-02 00:00:00</codeph> as <codeph>FM</codeph> is
+ applied to <codeph>DD</codeph> and not to the
+ separator(<codeph>-</codeph>).
+ </p>
</li>
- </ul></p>
+ </ul>
+ </p>
</entry>
</row>
<row>
- <entry>Free text</entry>
- <entry>Nested string</entry>
<entry>
- <p>You can specify a free text with surrounding double
- quotes (") in <varname>pattern</varname> where the same
- text is expected in the input argument without
- surrounding double quotes.</p>
- <p>In date/time to string conversions, the string is
- included in the output with the characters' case
- preserved.</p>
- <p> In string to date/time conversions, the nested string
- is not included in the resulting date/time object.
- However, the nested string has to match the related part
- of the input string, including the case.</p>
- <p>The following rules apply:<ul>
+ Free text
+ </entry>
+ <entry>
+ Nested string
+ </entry>
+ <entry>
+ <p>
+ You can specify a free text with surrounding double quotes (") in
+ <varname>pattern</varname> where the same text is expected in the input
+ argument without surrounding double quotes.
+ </p>
+
+
+
+ <p>
+ In date/time to string conversions, the string is included in the output
+ with the characters' case preserved.
+ </p>
+
+
+
+ <p>
+ In string to date/time conversions, the nested string is not included in
+ the resulting date/time object. However, the nested string has to match
+ the related part of the input string, including the case.
+ </p>
+
+
+
+ <p>
+ The following rules apply:
+ <ul>
<li>
- <p>If the <varname>pattern</varname> is surrounded
- by double quotes, double quotes surrounding the
- free text token must be escaped with a single
- backslash (<codeph>\"</codeph>).</p>
- <p>For example: <codeph>CAST('"Date:"2019-11-10' AS
- DATE FORMAT
- "<b>\"Date:\"</b>YYYY-MM-DD")</codeph></p>
+ <p>
+ If the <varname>pattern</varname> is surrounded by double quotes,
+ double quotes surrounding the free text token must be escaped with
+ a single backslash (<codeph>\"</codeph>).
+ </p>
+
+ <p>
+ For example: <codeph>CAST('"Date:"2019-11-10' AS DATE FORMAT
+ "<b>\"Date:\"</b>YYYY-MM-DD")</codeph>
+ </p>
</li>
+
<li>
- <p> If the <varname>pattern</varname> is surrounded
- by double quotes, and there is an escaped double
- quotes inside a text token that is itself
- surrounded by escaped double quotes, escape the
- double quotes in the free text token with a triple
- backslash: (<codeph>\\\"</codeph>)</p>
- <p>For example: <codeph>CAST("1985 some \"text
- 11-28" AS DATE''' FORMAT "YYYY<b>\" some
- \\\"text \"</b>MM-DD")</codeph></p>
+ <p>
+ If the <varname>pattern</varname> is surrounded by double quotes,
+ and there is an escaped double quotes inside a text token that is
+ itself surrounded by escaped double quotes, escape the double
+ quotes in the free text token with a triple backslash:
+ (<codeph>\\\"</codeph>)
+ </p>
+
+ <p>
+ For example: <codeph>CAST("1985 some \"text 11-28" AS DATE'''
+ FORMAT "YYYY<b>\" some \\\"text \"</b>MM-DD")</codeph>
+ </p>
</li>
+
<li>
- <p>If the <varname>pattern</varname> is surrounded
- by single quotes, the free text token can be
- surrounded by (non-escaped) double quotes. To
- include double quotes within the free text token,
- those double quotes must be escaped by a single
- backslash. </p>
- <p>For example: <codeph>CAST('"Date:"2019-11-10' AS
- DATE FORMAT
- '"<b>\"Date:\"</b>"YYYY-MM-DD')</codeph></p>
+ <p>
+ If the <varname>pattern</varname> is surrounded by single quotes,
+ the free text token can be surrounded by (non-escaped) double
+ quotes. To include double quotes within the free text token, those
+ double quotes must be escaped by a single backslash.
+ </p>
+
+ <p>
+ For example: <codeph>CAST('"Date:"2019-11-10' AS DATE FORMAT
+ '"<b>\"Date:\"</b>"YYYY-MM-DD')</codeph>
+ </p>
</li>
+
<li>
- <p> Literal single quotes/apostrophes
- (<codeph>'</codeph>) in the nested string must
- be escaped with a single backslash if the whole
- pattern string is delimited by single quotes.</p>
+ <p>
+ Literal single quotes/apostrophes (<codeph>'</codeph>) in the
+ nested string must be escaped with a single backslash if the whole
+ pattern string is delimited by single quotes.
+ </p>
</li>
+
<li>
- <p>If a free text token contains any separator
- characters in the beginning, and the text token is
- right after a separator token sequence, an error
- returns as it's not trivial to find where the
- separator sequence ends and where the free text
- starts. In this case, use <codeph>FX</codeph> for
- strict matching.</p>
- <p>For example: <codeph>CAST("1985-11- ' 10" AS DATE
- FORMAT "YYYY-MM-<b>\" ' \"</b>DD")</codeph>
- returns an error, but removing the dash before the
- text token makes this succeed.</p>
+ <p>
+ If a free text token contains any separator characters in the
+ beginning, and the text token is right after a separator token
+ sequence, an error returns as it's not trivial to find where the
+ separator sequence ends and where the free text starts. In this
+ case, use <codeph>FX</codeph> for strict matching.
+ </p>
+
+ <p>
+ For example: <codeph>CAST("1985-11- ' 10" AS DATE FORMAT
+ "YYYY-MM-<b>\" ' \"</b>DD")</codeph> returns an error, but
+ removing the dash before the text token makes this succeed.
+ </p>
</li>
- </ul></p>
+ </ul>
+ </p>
</entry>
</row>
</tbody>
</tgroup>
</table>
</p>
+
<p>
<b>Examples:</b>
- </p><table frame="all" rowsep="1" colsep="1" id="table_qqg_txn_r3b">
+ </p>
+ <table frame="all" rowsep="1" colsep="1" id="table_qqg_txn_r3b">
<tgroup cols="2" align="left">
<colspec colname="c1" colnum="1" colwidth="1*"/>
<colspec colname="c2" colnum="2" colwidth="1*"/>
<thead>
<row>
- <entry> Input </entry>
- <entry> Output </entry>
+ <entry>
+ Input
+ </entry>
+ <entry>
+ Output
+ </entry>
</row>
</thead>
<tbody>
<row>
<entry>
- <codeblock>CAST("02-11-2014" AS DATE FORMAT 'dd-mm-yyyy')</codeblock>
+<codeblock>CAST("02-11-2014" AS DATE FORMAT 'dd-mm-yyyy')</codeblock>
+ </entry>
+ <entry>
+ 2014-11-02
</entry>
- <entry> 2014-11-02 </entry>
</row>
<row>
<entry>
- <codeblock>CAST("365 2014" AS DATE FORMAT 'DDD-YYYY')</codeblock>
+<codeblock>CAST("365 2014" AS DATE FORMAT 'DDD-YYYY')</codeblock>
+ </entry>
+ <entry>
+ 2014-12-31
</entry>
- <entry> 2014-12-31 </entry>
</row>
<row>
<entry>
- <codeblock>CAST("5-01-26" AS DATE FORMAT 'YY-MM-DD')</codeblock>
+<codeblock>CAST("5-01-26" AS DATE FORMAT 'YY-MM-DD')</codeblock>
</entry>
- <entry> Executed at 2019-01-01 11:11:11: <p> 2015-01-26 </p>
+ <entry>
+ Executed at 2019-01-01 11:11:11:
+
+ <p>
+ 2015-01-26
+ </p>
</entry>
</row>
<row>
<entry>
- <codeblock>CAST('2018-11-10T15:11:04Z' AS TIMESTAMP
+<codeblock>CAST('2018-11-10T15:11:04Z' AS TIMESTAMP
FORMAT 'YYYY-MM-DDTHH24:MI:SSZ')</codeblock>
</entry>
- <entry> 2018-11-10 15:11:04 </entry>
+ <entry>
+ 2018-11-10 15:11:04
+ </entry>
</row>
<row>
<entry>
- <codeblock>CAST("95-01-28" AS DATE
+<codeblock>CAST("95-01-28" AS DATE
FORMAT 'YYY-MM-DD')</codeblock>
</entry>
- <entry> Executed at 2019-01-01 11:11:11: <p> 2095-01-28 </p>
+ <entry>
+ Executed at 2019-01-01 11:11:11:
+
+ <p>
+ 2095-01-28
+ </p>
</entry>
</row>
<row>
<entry>
- <codeblock>CAST("49-01-15" AS DATE
+<codeblock>CAST("49-01-15" AS DATE
FORMAT 'RR-MM-DD')</codeblock>
</entry>
- <entry> Round year when last 2 digits of current year is
- greater than 49. <p> Executed at 2099-01-01 11:11:11: </p>
- <p> 2149-01-15 </p>
+ <entry>
+ Round year when last 2 digits of current year is greater than 49.
+
+ <p>
+ Executed at 2099-01-01 11:11:11:
+ </p>
+
+
+
+ <p>
+ 2149-01-15
+ </p>
</entry>
</row>
<row>
<entry>
- <codeblock>CAST('2019.10.10 13:30:40.123456 +01:30'
+<codeblock>CAST('2019.10.10 13:30:40.123456 +01:30'
AS TIMESTAMP
FORMAT 'YYYY-MM-DD HH24:MI:SS.FF9 TZH:TZM') </codeblock>
</entry>
- <entry> 2019-10-10 13:30:40.123456000 </entry>
+ <entry>
+ 2019-10-10 13:30:40.123456000
+ </entry>
</row>
<row>
<entry>
- <codeblock>CAST('2001-03-01 03:10:15.123456 -01:30'
+<codeblock>CAST('2001-03-01 03:10:15.123456 -01:30'
AS TIMESTAMP
FORMAT 'FXYYYY-MM-DD HH12:MI:SS.FF6 TZH:TZM')</codeblock>
</entry>
- <entry>2001-03-01 03:10:15.123456000</entry>
+ <entry>
+ 2001-03-01 03:10:15.123456000
+ </entry>
</row>
<row>
<entry>
- <codeblock>CAST('2001-03-02 03:10:15'
+<codeblock>CAST('2001-03-02 03:10:15'
AS TIMESTAMP
FORMAT 'FXYYYY MM-DD HH12:MI:SS')</codeblock>
</entry>
- <entry>NULL because the separator between the year and month
- do not match.</entry>
+ <entry>
+ NULL because the separator between the year and month do not match.
+ </entry>
</row>
<row>
<entry>
- <codeblock>CAST('2001-3-05'
+<codeblock>CAST('2001-3-05'
AS TIMESTAMP
FORMAT 'FXYYYY-MM-DD')</codeblock>
</entry>
- <entry>NULL because the length of the month token does not
- match the <varname>pattern</varname>.</entry>
+ <entry>
+ NULL because the length of the month token does not match the
+ <varname>pattern</varname>.
+ </entry>
</row>
<row>
<entry>
- <codeblock>CAST('2001-3-11 3:15:00.12345'
+<codeblock>CAST('2001-3-11 3:15:00.12345'
AS TIMESTAMP
FORMAT 'FXYYYY-FMMM-DD FMHH12:MI:SS.FMFF')</codeblock>
</entry>
- <entry>2001-03-11 03:15:00.123450000<p>The multiple
- <codeph>FM</codeph> modifiers for the month and hour
- override the <codeph>FX</codeph> and suppress
- padding.</p></entry>
+ <entry>
+ 2001-03-11 03:15:00.123450000
+
+ <p>
+ The multiple <codeph>FM</codeph> modifiers for the month and hour override
+ the <codeph>FX</codeph> and suppress padding.
+ </p>
+ </entry>
</row>
<row>
<entry>
- <codeblock>CAST('2019-01-01 01:01:01'
+<codeblock>CAST('2019-01-01 01:01:01'
AS TIMESTAMP
FORMAT 'FMHH12:MI:FMSS')</codeblock>
</entry>
- <entry>1:01:1</entry>
+ <entry>
+ 1:01:1
+ </entry>
</row>
<row>
<entry>
- <codeblock>CAST('Date: 2019-11-10'
+<codeblock>CAST('Date: 2019-11-10'
AS DATE
FORMAT '"Date: "YYYY-MM-DD')
</codeblock>
</entry>
- <entry>2019-11-10</entry>
+ <entry>
+ 2019-11-10
+ </entry>
</row>
</tbody>
</tgroup>
[impala] 02/03: IMPALA-9207: [DOCS] Documented the #Inst in exec
summary
Posted by st...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
stakiar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
commit 306b606f84ceb1b5eaa8e12eb4d636529ab2f2dd
Author: Alex Rodoni <ar...@cloudera.com>
AuthorDate: Thu Dec 5 14:50:05 2019 -0800
IMPALA-9207: [DOCS] Documented the #Inst in exec summary
Change-Id: I938930c66144ba6bce766981d363abe4b28ba524
Reviewed-on: http://gerrit.cloudera.org:8080/14860
Tested-by: Impala Public Jenkins <im...@cloudera.com>
Reviewed-by: Alex Rodoni <ar...@cloudera.com>
---
docs/topics/impala_explain_plan.xml | 639 +++++++++---------------------------
docs/topics/impala_live_summary.xml | 128 --------
docs/topics/impala_mem_limit.xml | 22 +-
3 files changed, 170 insertions(+), 619 deletions(-)
diff --git a/docs/topics/impala_explain_plan.xml b/docs/topics/impala_explain_plan.xml
index cee5969..c60331c 100644
--- a/docs/topics/impala_explain_plan.xml
+++ b/docs/topics/impala_explain_plan.xml
@@ -21,7 +21,13 @@ under the License.
<concept id="explain_plan">
<title>Understanding Impala Query Performance - EXPLAIN Plans and Query Profiles</title>
- <titlealts audience="PDF"><navtitle>EXPLAIN Plans and Query Profiles</navtitle></titlealts>
+
+ <titlealts audience="PDF">
+
+ <navtitle>EXPLAIN Plans and Query Profiles</navtitle>
+
+ </titlealts>
+
<prolog>
<metadata>
<data name="Category" value="Performance"/>
@@ -39,34 +45,35 @@ under the License.
<conbody>
<p>
- To understand the high-level performance considerations for Impala queries, read the output of the
- <codeph>EXPLAIN</codeph> statement for the query. You can get the <codeph>EXPLAIN</codeph> plan without
- actually running the query itself.
+ To understand the high-level performance considerations for Impala queries, read the
+ output of the <codeph>EXPLAIN</codeph> statement for the query. You can get the
+ <codeph>EXPLAIN</codeph> plan without actually running the query itself.
</p>
<p rev="1.4.0">
- For an overview of the physical performance characteristics for a query, issue the <codeph>SUMMARY</codeph>
- statement in <cmdname>impala-shell</cmdname> immediately after executing a query. This condensed information
- shows which phases of execution took the most time, and how the estimates for memory usage and number of rows
- at each phase compare to the actual values.
+ For an overview of the physical performance characteristics for a query, issue the
+ <codeph>SUMMARY</codeph> statement in <cmdname>impala-shell</cmdname> immediately after
+ executing a query. This condensed information shows which phases of execution took the
+ most time, and how the estimates for memory usage and number of rows at each phase compare
+ to the actual values.
</p>
<p>
- To understand the detailed performance characteristics for a query, issue the <codeph>PROFILE</codeph>
- statement in <cmdname>impala-shell</cmdname> immediately after executing a query. This low-level information
- includes physical details about memory, CPU, I/O, and network usage, and thus is only available after the
- query is actually run.
+ To understand the detailed performance characteristics for a query, issue the
+ <codeph>PROFILE</codeph> statement in <cmdname>impala-shell</cmdname> immediately after
+ executing a query. This low-level information includes physical details about memory, CPU,
+ I/O, and network usage, and thus is only available after the query is actually run.
</p>
<p outputclass="toc inpage"/>
<p>
- Also, see <xref href="impala_hbase.xml#hbase_performance"/>
- and <xref href="impala_s3.xml#s3_performance"/>
- for examples of interpreting
- <codeph>EXPLAIN</codeph> plans for queries against HBase tables
- <ph rev="2.2.0">and data stored in the Amazon Simple Storage System (S3)</ph>.
+ Also, see <xref href="impala_hbase.xml#hbase_performance"/> and
+ <xref href="impala_s3.xml#s3_performance"/> for examples of interpreting
+ <codeph>EXPLAIN</codeph> plans for queries against HBase tables <ph rev="2.2.0">and data
+ stored in the Amazon Simple Storage System (S3)</ph>.
</p>
+
</conbody>
<concept id="perf_explain">
@@ -76,11 +83,12 @@ under the License.
<conbody>
<p>
- The <codeph><xref href="impala_explain.xml#explain">EXPLAIN</xref></codeph> statement gives you an outline
- of the logical steps that a query will perform, such as how the work will be distributed among the nodes
- and how intermediate results will be combined to produce the final result set. You can see these details
- before actually running the query. You can use this information to check that the query will not operate in
- some very unexpected or inefficient way.
+ The <codeph><xref href="impala_explain.xml#explain">EXPLAIN</xref></codeph> statement
+ gives you an outline of the logical steps that a query will perform, such as how the
+ work will be distributed among the nodes and how intermediate results will be combined
+ to produce the final result set. You can see these details before actually running the
+ query. You can use this information to check that the query will not operate in some
+ very unexpected or inefficient way.
</p>
<!-- Turn into a conref in ciiu_langref too. Relocate to common.xml. -->
@@ -90,23 +98,27 @@ under the License.
<p conref="../shared/impala_common.xml#common/explain_interpret"/>
<p>
- The <codeph>EXPLAIN</codeph> plan is also printed at the beginning of the query profile report described in
- <xref href="#perf_profile"/>, for convenience in examining both the logical and physical aspects of the
- query side-by-side.
+ The <codeph>EXPLAIN</codeph> plan is also printed at the beginning of the query profile
+ report described in <xref href="#perf_profile"/>, for convenience in examining both the
+ logical and physical aspects of the query side-by-side.
</p>
<p rev="1.2">
- The amount of detail displayed in the <codeph>EXPLAIN</codeph> output is controlled by the
- <xref href="impala_explain_level.xml#explain_level">EXPLAIN_LEVEL</xref> query option. You typically
- increase this setting from <codeph>standard</codeph> to <codeph>extended</codeph> (or from <codeph>1</codeph>
- to <codeph>2</codeph>) when doublechecking the presence of table and column statistics during performance
- tuning, or when estimating query resource usage in conjunction with the resource management features.
+ The amount of detail displayed in the <codeph>EXPLAIN</codeph> output is controlled by
+ the <xref href="impala_explain_level.xml#explain_level">EXPLAIN_LEVEL</xref> query
+ option. You typically increase this setting from <codeph>standard</codeph> to
+ <codeph>extended</codeph> (or from <codeph>1</codeph> to <codeph>2</codeph>) when
+ doublechecking the presence of table and column statistics during performance tuning, or
+ when estimating query resource usage in conjunction with the resource management
+ features.
</p>
- <!-- To do:
+<!-- To do:
This is a good place to have a few examples.
-->
+
</conbody>
+
</concept>
<concept id="perf_summary">
@@ -116,71 +128,65 @@ under the License.
<conbody>
<p>
- The <codeph><xref href="impala_shell_commands.xml#shell_commands">SUMMARY</xref></codeph> command within
- the <cmdname>impala-shell</cmdname> interpreter gives you an easy-to-digest overview of the timings for the
- different phases of execution for a query. Like the <codeph>EXPLAIN</codeph> plan, it is easy to see
- potential performance bottlenecks. Like the <codeph>PROFILE</codeph> output, it is available after the
- query is run and so displays actual timing numbers.
+ The
+ <codeph><xref href="impala_shell_commands.xml#shell_commands"
+ >SUMMARY</xref></codeph>
+ command within the <cmdname>impala-shell</cmdname> interpreter gives you an
+ easy-to-digest overview of the timings for the different phases of execution for a
+ query. Like the <codeph>EXPLAIN</codeph> plan, it is easy to see potential performance
+ bottlenecks. Like the <codeph>PROFILE</codeph> output, it is available after the query
+ is run and so displays actual timing numbers.
</p>
<p>
- The <codeph>SUMMARY</codeph> report is also printed at the beginning of the query profile report described
- in <xref href="#perf_profile"/>, for convenience in examining high-level and low-level aspects of the query
- side-by-side.
+ The <codeph>SUMMARY</codeph> report is also printed at the beginning of the query
+ profile report described in <xref href="#perf_profile"/>, for convenience in examining
+ high-level and low-level aspects of the query side-by-side.
</p>
<p>
- For example, here is a query involving an aggregate function, on a single-node VM. The different stages of
- the query and their timings are shown (rolled up for all nodes), along with estimated and actual values
- used in planning the query. In this case, the <codeph>AVG()</codeph> function is computed for a subset of
- data on each node (stage 01) and then the aggregated results from all nodes are combined at the end (stage
- 03). You can see which stages took the most time, and whether any estimates were substantially different
- than the actual data distribution. (When examining the time values, be sure to consider the suffixes such
- as <codeph>us</codeph> for microseconds and <codeph>ms</codeph> for milliseconds, rather than just looking
- for the largest numbers.)
+ When the <codeph>MT_DOP</codeph> query option is set to a value larger than
+ <codeph>0</codeph>, the <codeph>#Inst</codeph> column in the output shows the number of
+ fragment instances. Impala decomposes each query into smaller units of work that are
+ distributed across the cluster, and these units are referred as fragments.
</p>
-<codeblock>[localhost:21000] > select avg(ss_sales_price) from store_sales where ss_coupon_amt = 0;
-+---------------------+
-| avg(ss_sales_price) |
-+---------------------+
-| 37.80770926328327 |
-+---------------------+
-[localhost:21000] > summary;
-+--------------+--------+----------+----------+-------+------------+----------+---------------+-----------------+
-| Operator | #Hosts | Avg Time | Max Time | #Rows | Est. #Rows | Peak Mem | Est. Peak Mem | Detail |
-+--------------+--------+----------+----------+-------+------------+----------+---------------+-----------------+
-| 03:AGGREGATE | 1 | 1.03ms | 1.03ms | 1 | 1 | 48.00 KB | -1 B | MERGE FINALIZE |
-| 02:EXCHANGE | 1 | 0ns | 0ns | 1 | 1 | 0 B | -1 B | UNPARTITIONED |
-| 01:AGGREGATE | 1 | 30.79ms | 30.79ms | 1 | 1 | 80.00 KB | 10.00 MB | |
-| 00:SCAN HDFS | 1 | 5.45s | 5.45s | 2.21M | -1 | 64.05 MB | 432.00 MB | tpc.store_sales |
-+--------------+--------+----------+----------+-------+------------+----------+---------------+-----------------+
-</codeblock>
-
<p>
- Notice how the longest initial phase of the query is measured in seconds (s), while later phases working on
- smaller intermediate results are measured in milliseconds (ms) or even nanoseconds (ns).
+ When the <codeph>MT_DOP</codeph> query option is set to 0, the <codeph>#Inst</codeph>
+ column in the output shows the same value as the <codeph>#Hosts</codeph> column, since
+ there is exactly one fragment for each host.
</p>
<p>
- Here is an example from a more complicated query, as it would appear in the <codeph>PROFILE</codeph>
- output:
+ For example, here is a query involving an aggregate function, on a single-node cluster.
+ The different stages of the query and their timings are shown (rolled up for all nodes),
+ along with estimated and actual values used in planning the query. In this case, the
+ <codeph>AVG()</codeph> function is computed for a subset of data on each node (stage 01)
+ and then the aggregated results from all nodes are combined at the end (stage 03). You
+ can see which stages took the most time, and whether any estimates were substantially
+ different than the actual data distribution.
</p>
-<codeblock>Operator #Hosts Avg Time Max Time #Rows Est. #Rows Peak Mem Est. Peak Mem Detail
-------------------------------------------------------------------------------------------------------------------------
-09:MERGING-EXCHANGE 1 79.738us 79.738us 5 5 0 -1.00 B UNPARTITIONED
-05:TOP-N 3 84.693us 88.810us 5 5 12.00 KB 120.00 B
-04:AGGREGATE 3 5.263ms 6.432ms 5 5 44.00 KB 10.00 MB MERGE FINALIZE
-08:AGGREGATE 3 16.659ms 27.444ms 52.52K 600.12K 3.20 MB 15.11 MB MERGE
-07:EXCHANGE 3 2.644ms 5.1ms 52.52K 600.12K 0 0 HASH(o_orderpriority)
-03:AGGREGATE 3 342.913ms 966.291ms 52.52K 600.12K 10.80 MB 15.11 MB
-02:HASH JOIN 3 2s165ms 2s171ms 144.87K 600.12K 13.63 MB 941.01 KB INNER JOIN, BROADCAST
-|--06:EXCHANGE 3 8.296ms 8.692ms 57.22K 15.00K 0 0 BROADCAST
-| 01:SCAN HDFS 2 1s412ms 1s978ms 57.22K 15.00K 24.21 MB 176.00 MB tpch.orders o
-00:SCAN HDFS 3 8s032ms 8s558ms 3.79M 600.12K 32.29 MB 264.00 MB tpch.lineitem l
+<codeblock>> SELECT AVG(ss_sales_price) FROM store_sales WHERE ss_coupon_amt = 0;
+> SUMMARY;
++--------------+--------+--------+----------+----------+-------+------------+----------+---------------+-----------------+
+| Operator | #Hosts | #Inst | Avg Time | Max Time | #Rows | Est. #Rows | Peak Mem | Est. Peak Mem | Detail |
++--------------+--------+--------+----------+----------+-------+------------+----------+---------------+-----------------+
+| 03:AGGREGATE | 1 | 1 | 1.03ms | 1.03ms | 1 | 1 | 48.00 KB | -1 B | MERGE FINALIZE |
+| 02:EXCHANGE | 1 | 1 | 0ns | 0ns | 1 | 1 | 0 B | -1 B | UNPARTITIONED |
+| 01:AGGREGATE | 1 | 1 |30.79ms | 30.79ms | 1 | 1 | 80.00 KB | 10.00 MB | |
+| 00:SCAN HDFS | 1 | 1 | 5.45s | 5.45s | 2.21M | -1 | 64.05 MB | 432.00 MB | tpc.store_sales |
++--------------+--------+--------+----------+----------+-------+------------+----------+---------------+-----------------+
</codeblock>
+
+ <p>
+ Notice how the longest initial phase of the query is measured in seconds (s), while
+ later phases working on smaller intermediate results are measured in milliseconds (ms)
+ or even nanoseconds (ns).
+ </p>
+
</conbody>
+
</concept>
<concept id="perf_profile">
@@ -189,417 +195,90 @@ under the License.
<conbody>
- <p> The <codeph>PROFILE</codeph> command, available in the
- <cmdname>impala-shell</cmdname> interpreter, produces a detailed
- low-level report showing how the most recent query was executed. Unlike
- the <codeph>EXPLAIN</codeph> plan described in <xref
+ <p>
+ The <codeph>PROFILE</codeph> command, available in the <cmdname>impala-shell</cmdname>
+ interpreter, produces a detailed low-level report showing how the most recent query was
+ executed. Unlike the <codeph>EXPLAIN</codeph> plan described in
+ <xref
href="#perf_explain"/>, this information is only available after the
- query has finished. It shows physical details such as the number of
- bytes read, maximum memory usage, and so on for each node. You can use
- this information to determine if the query is I/O-bound or CPU-bound,
- whether some network condition is imposing a bottleneck, whether a
- slowdown is affecting some nodes but not others, and to check that
- recommended configuration settings such as short-circuit local reads are
- in effect. </p>
+ query has finished. It shows physical details such as the number of bytes read, maximum
+ memory usage, and so on for each node. You can use this information to determine if the
+ query is I/O-bound or CPU-bound, whether some network condition is imposing a
+ bottleneck, whether a slowdown is affecting some nodes but not others, and to check that
+ recommended configuration settings such as short-circuit local reads are in effect.
+ </p>
<p rev="">
- By default, time values in the profile output reflect the wall-clock time taken by an operation.
- For values denoting system time or user time, the measurement unit is reflected in the metric
- name, such as <codeph>ScannerThreadsSysTime</codeph> or <codeph>ScannerThreadsUserTime</codeph>.
- For example, a multi-threaded I/O operation might show a small figure for wall-clock time,
- while the corresponding system time is larger, representing the sum of the CPU time taken by each thread.
- Or a wall-clock time figure might be larger because it counts time spent waiting, while
- the corresponding system and user time figures only measure the time while the operation
- is actively using CPU cycles.
+ By default, time values in the profile output reflect the wall-clock time taken by an
+ operation. For values denoting system time or user time, the measurement unit is
+ reflected in the metric name, such as <codeph>ScannerThreadsSysTime</codeph> or
+ <codeph>ScannerThreadsUserTime</codeph>. For example, a multi-threaded I/O operation
+ might show a small figure for wall-clock time, while the corresponding system time is
+ larger, representing the sum of the CPU time taken by each thread. Or a wall-clock time
+ figure might be larger because it counts time spent waiting, while the corresponding
+ system and user time figures only measure the time while the operation is actively using
+ CPU cycles.
</p>
<p>
- The <xref href="impala_explain_plan.xml#perf_explain"><codeph>EXPLAIN</codeph> plan</xref> is also printed
- at the beginning of the query profile report, for convenience in examining both the logical and physical
- aspects of the query side-by-side. The
- <xref href="impala_explain_level.xml#explain_level">EXPLAIN_LEVEL</xref> query option also controls the
- verbosity of the <codeph>EXPLAIN</codeph> output printed by the <codeph>PROFILE</codeph> command.
+ The <xref href="impala_explain_plan.xml#perf_explain"><codeph>EXPLAIN</codeph>
+ plan</xref> is also printed at the beginning of the query profile report, for
+ convenience in examining both the logical and physical aspects of the query
+ side-by-side. The
+ <xref href="impala_explain_level.xml#explain_level">EXPLAIN_LEVEL</xref> query option
+ also controls the verbosity of the <codeph>EXPLAIN</codeph> output printed by the
+ <codeph>PROFILE</codeph> command.
</p>
- <p>In <keyword keyref="impala32_full"/>, a new <codeph>Per Node
- Profiles</codeph> section was added to the profile output. The new
- section includes the following metrics that can be controlled by the
- <codeph><xref
+
+ <p>
+ In <keyword keyref="impala32_full"/>, a new <codeph>Per Node Profiles</codeph> section
+ was added to the profile output. The new section includes the following metrics that can
+ be controlled by the
+ <codeph><xref
href="impala_resource_trace_ratio.xml#resource_trace_ratio"
- >RESOURCE_TRACE_RATIO</xref></codeph> query option.</p>
+ >RESOURCE_TRACE_RATIO</xref></codeph>
+ query option.
+ </p>
+
<ul>
- <li><codeph>CpuIoWaitPercentage</codeph>
+ <li>
+ <codeph>CpuIoWaitPercentage</codeph>
+ </li>
+
+ <li>
+ <codeph>CpuSysPercentage</codeph>
+ </li>
+
+ <li>
+ <codeph>CpuUserPercentage</codeph>
+ </li>
+
+ <li>
+ <codeph>HostDiskReadThroughput</codeph>: All data read by the host as part of the
+ execution of this query (spilling), by the HDFS data node, and by other processes
+ running on the same system.
+ </li>
+
+ <li>
+ <codeph>HostDiskWriteThroughput</codeph>: All data written by the host as part of the
+ execution of this query (spilling), by the HDFS data node, and by other processes
+ running on the same system.
+ </li>
+
+ <li>
+ <codeph>HostNetworkRx</codeph>: All data received by the host as part of the execution
+ of this query, other queries, and other processes running on the same system.
+ </li>
+
+ <li>
+ <codeph>HostNetworkTx</codeph>: All data transmitted by the host as part of the
+ execution of this query, other queries, and other processes running on the same
+ system.
</li>
- <li><codeph>CpuSysPercentage</codeph></li>
- <li><codeph>CpuUserPercentage</codeph></li>
- <li><codeph>HostDiskReadThroughput</codeph>: All data read by the host
- as part of the execution of this query (spilling), by the HDFS data
- node, and by other processes running on the same system.</li>
- <li><codeph>HostDiskWriteThroughput</codeph>: All data written by the
- host as part of the execution of this query (spilling), by the HDFS
- data node, and by other processes running on the same system.</li>
- <li><codeph>HostNetworkRx</codeph>: All data received by the host as
- part of the execution of this query, other queries, and other
- processes running on the same system. </li>
- <li><codeph>HostNetworkTx</codeph>: All data transmitted by the host as
- part of the execution of this query, other queries, and other
- processes running on the same system. </li>
</ul>
- <!--AR 3/11/2019 The below example is out dated and does not add much value. Hiding it until this doc gets refactored.-->
-
- <p audience="hidden"> Here is an example of a query profile, from a
- relatively straightforward query on a single-node pseudo-distributed
- cluster to keep the output relatively brief. </p>
-
-<codeblock audience="hidden">[localhost:21000] > profile;
-Query Runtime Profile:
-Query (id=6540a03d4bee0691:4963d6269b210ebd):
- Summary:
- Session ID: ea4a197f1c7bf858:c74e66f72e3a33ba
- Session Type: BEESWAX
- Start Time: 2013-12-02 17:10:30.263067000
- End Time: 2013-12-02 17:10:50.932044000
- Query Type: QUERY
- Query State: FINISHED
- Query Status: OK
- Impala Version: impalad version 1.2.1 RELEASE (build edb5af1bcad63d410bc5d47cc203df3a880e9324)
- User: doc_demo
- Network Address: 127.0.0.1:49161
- Default Db: stats_testing
- Sql Statement: select t1.s, t2.s from t1 join t2 on (t1.id = t2.parent)
- Plan:
-----------------
-Estimated Per-Host Requirements: Memory=2.09GB VCores=2
-
-PLAN FRAGMENT 0
- PARTITION: UNPARTITIONED
-
- 4:EXCHANGE
- cardinality: unavailable
- per-host memory: unavailable
- tuple ids: 0 1
-
-PLAN FRAGMENT 1
- PARTITION: RANDOM
-
- STREAM DATA SINK
- EXCHANGE ID: 4
- UNPARTITIONED
-
- 2:HASH JOIN
- | join op: INNER JOIN (BROADCAST)
- | hash predicates:
- | t1.id = t2.parent
- | cardinality: unavailable
- | per-host memory: 2.00GB
- | tuple ids: 0 1
- |
- |----3:EXCHANGE
- | cardinality: unavailable
- | per-host memory: 0B
- | tuple ids: 1
- |
- 0:SCAN HDFS
- table=stats_testing.t1 #partitions=1/1 size=33B
- table stats: unavailable
- column stats: unavailable
- cardinality: unavailable
- per-host memory: 32.00MB
- tuple ids: 0
-
-PLAN FRAGMENT 2
- PARTITION: RANDOM
-
- STREAM DATA SINK
- EXCHANGE ID: 3
- UNPARTITIONED
-
- 1:SCAN HDFS
- table=stats_testing.t2 #partitions=1/1 size=960.00KB
- table stats: unavailable
- column stats: unavailable
- cardinality: unavailable
- per-host memory: 96.00MB
- tuple ids: 1
-----------------
- Query Timeline: 20s670ms
- - Start execution: 2.559ms (2.559ms)
- - Planning finished: 23.587ms (21.27ms)
- - Rows available: 666.199ms (642.612ms)
- - First row fetched: 668.919ms (2.719ms)
- - Unregister query: 20s668ms (20s000ms)
- ImpalaServer:
- - ClientFetchWaitTimer: 19s637ms
- - RowMaterializationTimer: 167.121ms
- Execution Profile 6540a03d4bee0691:4963d6269b210ebd:(Active: 837.815ms, % non-child: 0.00%)
- Per Node Peak Memory Usage: impala-1.example.com:22000(7.42 MB)
- - FinalizationTimer: 0ns
- Coordinator Fragment:(Active: 195.198ms, % non-child: 0.00%)
- MemoryUsage(500.0ms): 16.00 KB, 7.42 MB, 7.33 MB, 7.10 MB, 6.94 MB, 6.71 MB, 6.56 MB, 6.40 MB, 6.17 MB, 6.02 MB, 5.79 MB, 5.63 MB, 5.48 MB, 5.25 MB, 5.09 MB, 4.86 MB, 4.71 MB, 4.47 MB, 4.32 MB, 4.09 MB, 3.93 MB, 3.78 MB, 3.55 MB, 3.39 MB, 3.16 MB, 3.01 MB, 2.78 MB, 2.62 MB, 2.39 MB, 2.24 MB, 2.08 MB, 1.85 MB, 1.70 MB, 1.54 MB, 1.31 MB, 1.16 MB, 948.00 KB, 790.00 KB, 553.00 KB, 395.00 KB, 237.00 KB
- ThreadUsage(500.0ms): 1
- - AverageThreadTokens: 1.00
- - PeakMemoryUsage: 7.42 MB
- - PrepareTime: 36.144us
- - RowsProduced: 98.30K (98304)
- - TotalCpuTime: 20s449ms
- - TotalNetworkWaitTime: 191.630ms
- - TotalStorageWaitTime: 0ns
- CodeGen:(Active: 150.679ms, % non-child: 77.19%)
- - CodegenTime: 0ns
- - CompileTime: 139.503ms
- - LoadTime: 10.7ms
- - ModuleFileSize: 95.27 KB
- EXCHANGE_NODE (id=4):(Active: 194.858ms, % non-child: 99.83%)
- - BytesReceived: 2.33 MB
- - ConvertRowBatchTime: 2.732ms
- - DataArrivalWaitTime: 191.118ms
- - DeserializeRowBatchTimer: 14.943ms
- - FirstBatchArrivalWaitTime: 191.117ms
- - PeakMemoryUsage: 7.41 MB
- - RowsReturned: 98.30K (98304)
- - RowsReturnedRate: 504.49 K/sec
- - SendersBlockedTimer: 0ns
- - SendersBlockedTotalTimer(*): 0ns
- Averaged Fragment 1:(Active: 442.360ms, % non-child: 0.00%)
- split sizes: min: 33.00 B, max: 33.00 B, avg: 33.00 B, stddev: 0.00
- completion times: min:443.720ms max:443.720ms mean: 443.720ms stddev:0ns
- execution rates: min:74.00 B/sec max:74.00 B/sec mean:74.00 B/sec stddev:0.00 /sec
- num instances: 1
- - AverageThreadTokens: 1.00
- - PeakMemoryUsage: 6.06 MB
- - PrepareTime: 7.291ms
- - RowsProduced: 98.30K (98304)
- - TotalCpuTime: 784.259ms
- - TotalNetworkWaitTime: 388.818ms
- - TotalStorageWaitTime: 3.934ms
- CodeGen:(Active: 312.862ms, % non-child: 70.73%)
- - CodegenTime: 2.669ms
- - CompileTime: 302.467ms
- - LoadTime: 9.231ms
- - ModuleFileSize: 95.27 KB
- DataStreamSender (dst_id=4):(Active: 80.63ms, % non-child: 18.10%)
- - BytesSent: 2.33 MB
- - NetworkThroughput(*): 35.89 MB/sec
- - OverallThroughput: 29.06 MB/sec
- - PeakMemoryUsage: 5.33 KB
- - SerializeBatchTime: 26.487ms
- - ThriftTransmitTime(*): 64.814ms
- - UncompressedRowBatchSize: 6.66 MB
- HASH_JOIN_NODE (id=2):(Active: 362.25ms, % non-child: 3.92%)
- - BuildBuckets: 1.02K (1024)
- - BuildRows: 98.30K (98304)
- - BuildTime: 12.622ms
- - LoadFactor: 0.00
- - PeakMemoryUsage: 6.02 MB
- - ProbeRows: 3
- - ProbeTime: 3.579ms
- - RowsReturned: 98.30K (98304)
- - RowsReturnedRate: 271.54 K/sec
- EXCHANGE_NODE (id=3):(Active: 344.680ms, % non-child: 77.92%)
- - BytesReceived: 1.15 MB
- - ConvertRowBatchTime: 2.792ms
- - DataArrivalWaitTime: 339.936ms
- - DeserializeRowBatchTimer: 9.910ms
- - FirstBatchArrivalWaitTime: 199.474ms
- - PeakMemoryUsage: 156.00 KB
- - RowsReturned: 98.30K (98304)
- - RowsReturnedRate: 285.20 K/sec
- - SendersBlockedTimer: 0ns
- - SendersBlockedTotalTimer(*): 0ns
- HDFS_SCAN_NODE (id=0):(Active: 13.616us, % non-child: 0.00%)
- - AverageHdfsReadThreadConcurrency: 0.00
- - AverageScannerThreadConcurrency: 0.00
- - BytesRead: 33.00 B
- - BytesReadLocal: 33.00 B
- - BytesReadShortCircuit: 33.00 B
- - NumDisksAccessed: 1
- - NumScannerThreadsStarted: 1
- - PeakMemoryUsage: 46.00 KB
- - PerReadThreadRawHdfsThroughput: 287.52 KB/sec
- - RowsRead: 3
- - RowsReturned: 3
- - RowsReturnedRate: 220.33 K/sec
- - ScanRangesComplete: 1
- - ScannerThreadsInvoluntaryContextSwitches: 26
- - ScannerThreadsTotalWallClockTime: 55.199ms
- - DelimiterParseTime: 2.463us
- - MaterializeTupleTime(*): 1.226us
- - ScannerThreadsSysTime: 0ns
- - ScannerThreadsUserTime: 42.993ms
- - ScannerThreadsVoluntaryContextSwitches: 1
- - TotalRawHdfsReadTime(*): 112.86us
- - TotalReadThroughput: 0.00 /sec
- Averaged Fragment 2:(Active: 190.120ms, % non-child: 0.00%)
- split sizes: min: 960.00 KB, max: 960.00 KB, avg: 960.00 KB, stddev: 0.00
- completion times: min:191.736ms max:191.736ms mean: 191.736ms stddev:0ns
- execution rates: min:4.89 MB/sec max:4.89 MB/sec mean:4.89 MB/sec stddev:0.00 /sec
- num instances: 1
- - AverageThreadTokens: 0.00
- - PeakMemoryUsage: 906.33 KB
- - PrepareTime: 3.67ms
- - RowsProduced: 98.30K (98304)
- - TotalCpuTime: 403.351ms
- - TotalNetworkWaitTime: 34.999ms
- - TotalStorageWaitTime: 108.675ms
- CodeGen:(Active: 162.57ms, % non-child: 85.24%)
- - CodegenTime: 3.133ms
- - CompileTime: 148.316ms
- - LoadTime: 12.317ms
- - ModuleFileSize: 95.27 KB
- DataStreamSender (dst_id=3):(Active: 70.620ms, % non-child: 37.14%)
- - BytesSent: 1.15 MB
- - NetworkThroughput(*): 23.30 MB/sec
- - OverallThroughput: 16.23 MB/sec
- - PeakMemoryUsage: 5.33 KB
- - SerializeBatchTime: 22.69ms
- - ThriftTransmitTime(*): 49.178ms
- - UncompressedRowBatchSize: 3.28 MB
- HDFS_SCAN_NODE (id=1):(Active: 118.839ms, % non-child: 62.51%)
- - AverageHdfsReadThreadConcurrency: 0.00
- - AverageScannerThreadConcurrency: 0.00
- - BytesRead: 960.00 KB
- - BytesReadLocal: 960.00 KB
- - BytesReadShortCircuit: 960.00 KB
- - NumDisksAccessed: 1
- - NumScannerThreadsStarted: 1
- - PeakMemoryUsage: 869.00 KB
- - PerReadThreadRawHdfsThroughput: 130.21 MB/sec
- - RowsRead: 98.30K (98304)
- - RowsReturned: 98.30K (98304)
- - RowsReturnedRate: 827.20 K/sec
- - ScanRangesComplete: 15
- - ScannerThreadsInvoluntaryContextSwitches: 34
- - ScannerThreadsTotalWallClockTime: 189.774ms
- - DelimiterParseTime: 15.703ms
- - MaterializeTupleTime(*): 3.419ms
- - ScannerThreadsSysTime: 1.999ms
- - ScannerThreadsUserTime: 44.993ms
- - ScannerThreadsVoluntaryContextSwitches: 118
- - TotalRawHdfsReadTime(*): 7.199ms
- - TotalReadThroughput: 0.00 /sec
- Fragment 1:
- Instance 6540a03d4bee0691:4963d6269b210ebf (host=impala-1.example.com:22000):(Active: 442.360ms, % non-child: 0.00%)
- Hdfs split stats (<volume id>:<# splits>/<split lengths>): 0:1/33.00 B
- MemoryUsage(500.0ms): 69.33 KB
- ThreadUsage(500.0ms): 1
- - AverageThreadTokens: 1.00
- - PeakMemoryUsage: 6.06 MB
- - PrepareTime: 7.291ms
- - RowsProduced: 98.30K (98304)
- - TotalCpuTime: 784.259ms
- - TotalNetworkWaitTime: 388.818ms
- - TotalStorageWaitTime: 3.934ms
- CodeGen:(Active: 312.862ms, % non-child: 70.73%)
- - CodegenTime: 2.669ms
- - CompileTime: 302.467ms
- - LoadTime: 9.231ms
- - ModuleFileSize: 95.27 KB
- DataStreamSender (dst_id=4):(Active: 80.63ms, % non-child: 18.10%)
- - BytesSent: 2.33 MB
- - NetworkThroughput(*): 35.89 MB/sec
- - OverallThroughput: 29.06 MB/sec
- - PeakMemoryUsage: 5.33 KB
- - SerializeBatchTime: 26.487ms
- - ThriftTransmitTime(*): 64.814ms
- - UncompressedRowBatchSize: 6.66 MB
- HASH_JOIN_NODE (id=2):(Active: 362.25ms, % non-child: 3.92%)
- ExecOption: Build Side Codegen Enabled, Probe Side Codegen Enabled, Hash Table Built Asynchronously
- - BuildBuckets: 1.02K (1024)
- - BuildRows: 98.30K (98304)
- - BuildTime: 12.622ms
- - LoadFactor: 0.00
- - PeakMemoryUsage: 6.02 MB
- - ProbeRows: 3
- - ProbeTime: 3.579ms
- - RowsReturned: 98.30K (98304)
- - RowsReturnedRate: 271.54 K/sec
- EXCHANGE_NODE (id=3):(Active: 344.680ms, % non-child: 77.92%)
- - BytesReceived: 1.15 MB
- - ConvertRowBatchTime: 2.792ms
- - DataArrivalWaitTime: 339.936ms
- - DeserializeRowBatchTimer: 9.910ms
- - FirstBatchArrivalWaitTime: 199.474ms
- - PeakMemoryUsage: 156.00 KB
- - RowsReturned: 98.30K (98304)
- - RowsReturnedRate: 285.20 K/sec
- - SendersBlockedTimer: 0ns
- - SendersBlockedTotalTimer(*): 0ns
- HDFS_SCAN_NODE (id=0):(Active: 13.616us, % non-child: 0.00%)
- Hdfs split stats (<volume id>:<# splits>/<split lengths>): 0:1/33.00 B
- Hdfs Read Thread Concurrency Bucket: 0:0% 1:0%
- File Formats: TEXT/NONE:1
- ExecOption: Codegen enabled: 1 out of 1
- - AverageHdfsReadThreadConcurrency: 0.00
- - AverageScannerThreadConcurrency: 0.00
- - BytesRead: 33.00 B
- - BytesReadLocal: 33.00 B
- - BytesReadShortCircuit: 33.00 B
- - NumDisksAccessed: 1
- - NumScannerThreadsStarted: 1
- - PeakMemoryUsage: 46.00 KB
- - PerReadThreadRawHdfsThroughput: 287.52 KB/sec
- - RowsRead: 3
- - RowsReturned: 3
- - RowsReturnedRate: 220.33 K/sec
- - ScanRangesComplete: 1
- - ScannerThreadsInvoluntaryContextSwitches: 26
- - ScannerThreadsTotalWallClockTime: 55.199ms
- - DelimiterParseTime: 2.463us
- - MaterializeTupleTime(*): 1.226us
- - ScannerThreadsSysTime: 0ns
- - ScannerThreadsUserTime: 42.993ms
- - ScannerThreadsVoluntaryContextSwitches: 1
- - TotalRawHdfsReadTime(*): 112.86us
- - TotalReadThroughput: 0.00 /sec
- Fragment 2:
- Instance 6540a03d4bee0691:4963d6269b210ec0 (host=impala-1.example.com:22000):(Active: 190.120ms, % non-child: 0.00%)
- Hdfs split stats (<volume id>:<# splits>/<split lengths>): 0:15/960.00 KB
- - AverageThreadTokens: 0.00
- - PeakMemoryUsage: 906.33 KB
- - PrepareTime: 3.67ms
- - RowsProduced: 98.30K (98304)
- - TotalCpuTime: 403.351ms
- - TotalNetworkWaitTime: 34.999ms
- - TotalStorageWaitTime: 108.675ms
- CodeGen:(Active: 162.57ms, % non-child: 85.24%)
- - CodegenTime: 3.133ms
- - CompileTime: 148.316ms
- - LoadTime: 12.317ms
- - ModuleFileSize: 95.27 KB
- DataStreamSender (dst_id=3):(Active: 70.620ms, % non-child: 37.14%)
- - BytesSent: 1.15 MB
- - NetworkThroughput(*): 23.30 MB/sec
- - OverallThroughput: 16.23 MB/sec
- - PeakMemoryUsage: 5.33 KB
- - SerializeBatchTime: 22.69ms
- - ThriftTransmitTime(*): 49.178ms
- - UncompressedRowBatchSize: 3.28 MB
- HDFS_SCAN_NODE (id=1):(Active: 118.839ms, % non-child: 62.51%)
- Hdfs split stats (<volume id>:<# splits>/<split lengths>): 0:15/960.00 KB
- Hdfs Read Thread Concurrency Bucket: 0:0% 1:0%
- File Formats: TEXT/NONE:15
- ExecOption: Codegen enabled: 15 out of 15
- - AverageHdfsReadThreadConcurrency: 0.00
- - AverageScannerThreadConcurrency: 0.00
- - BytesRead: 960.00 KB
- - BytesReadLocal: 960.00 KB
- - BytesReadShortCircuit: 960.00 KB
- - NumDisksAccessed: 1
- - NumScannerThreadsStarted: 1
- - PeakMemoryUsage: 869.00 KB
- - PerReadThreadRawHdfsThroughput: 130.21 MB/sec
- - RowsRead: 98.30K (98304)
- - RowsReturned: 98.30K (98304)
- - RowsReturnedRate: 827.20 K/sec
- - ScanRangesComplete: 15
- - ScannerThreadsInvoluntaryContextSwitches: 34
- - ScannerThreadsTotalWallClockTime: 189.774ms
- - DelimiterParseTime: 15.703ms
- - MaterializeTupleTime(*): 3.419ms
- - ScannerThreadsSysTime: 1.999ms
- - ScannerThreadsUserTime: 44.993ms
- - ScannerThreadsVoluntaryContextSwitches: 118
- - TotalRawHdfsReadTime(*): 7.199ms
- - TotalReadThroughput: 0.00 /sec</codeblock>
+
</conbody>
+
</concept>
+
</concept>
diff --git a/docs/topics/impala_live_summary.xml b/docs/topics/impala_live_summary.xml
index 087fce3..36e3449 100644
--- a/docs/topics/impala_live_summary.xml
+++ b/docs/topics/impala_live_summary.xml
@@ -79,134 +79,6 @@ under the License.
<p
conref="../shared/impala_common.xml#common/impala_shell_progress_reports_shell_only_caveat"/>
<p conref="../shared/impala_common.xml#common/added_in_230"/>
- <p conref="../shared/impala_common.xml#common/example_blurb"/>
- <p> The following example shows a series of <codeph>LIVE_SUMMARY</codeph>
- reports that are displayed during the course of a query, showing how the
- numbers increase to show the progress of different phases of the
- distributed query. When you do the same in
- <cmdname>impala-shell</cmdname>, only a single report is displayed at any
- one time, with each update overwriting the previous numbers. </p>
- <codeblock><![CDATA[[localhost:21000] > set live_summary=true;
-LIVE_SUMMARY set to true
-[localhost:21000] > select count(*) from customer t1 cross join customer t2;
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-| Operator | #Hosts | Avg Time | Max Time | #Rows | Est. #Rows | Peak Mem | Est. Peak Mem | Detail |
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-| 06:AGGREGATE | 0 | 0ns | 0ns | 0 | 1 | 0 B | -1 B | FINALIZE |
-| 05:EXCHANGE | 0 | 0ns | 0ns | 0 | 1 | 0 B | -1 B | UNPARTITIONED |
-| 03:AGGREGATE | 0 | 0ns | 0ns | 0 | 1 | 0 B | 10.00 MB | |
-| 02:NESTED LOOP JOIN | 0 | 0ns | 0ns | 0 | 22.50B | 0 B | 0 B | CROSS JOIN, BROADCAST |
-| |--04:EXCHANGE | 0 | 0ns | 0ns | 0 | 150.00K | 0 B | 0 B | BROADCAST |
-| | 01:SCAN HDFS | 1 | 503.57ms | 503.57ms | 150.00K | 150.00K | 24.09 MB | 64.00 MB | tpch.customer t2 |
-| 00:SCAN HDFS | 0 | 0ns | 0ns | 0 | 150.00K | 0 B | 64.00 MB | tpch.customer t1 |
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-| Operator | #Hosts | Avg Time | Max Time | #Rows | Est. #Rows | Peak Mem | Est. Peak Mem | Detail |
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-| 06:AGGREGATE | 0 | 0ns | 0ns | 0 | 1 | 0 B | -1 B | FINALIZE |
-| 05:EXCHANGE | 0 | 0ns | 0ns | 0 | 1 | 0 B | -1 B | UNPARTITIONED |
-| 03:AGGREGATE | 1 | 0ns | 0ns | 0 | 1 | 20.00 KB | 10.00 MB | |
-| 02:NESTED LOOP JOIN | 1 | 17.62s | 17.62s | 81.14M | 22.50B | 3.23 MB | 0 B | CROSS JOIN, BROADCAST |
-| |--04:EXCHANGE | 1 | 26.29ms | 26.29ms | 150.00K | 150.00K | 0 B | 0 B | BROADCAST |
-| | 01:SCAN HDFS | 1 | 503.57ms | 503.57ms | 150.00K | 150.00K | 24.09 MB | 64.00 MB | tpch.customer t2 |
-| 00:SCAN HDFS | 1 | 247.53ms | 247.53ms | 1.02K | 150.00K | 24.39 MB | 64.00 MB | tpch.customer t1 |
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-| Operator | #Hosts | Avg Time | Max Time | #Rows | Est. #Rows | Peak Mem | Est. Peak Mem | Detail |
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-| 06:AGGREGATE | 0 | 0ns | 0ns | 0 | 1 | 0 B | -1 B | FINALIZE |
-| 05:EXCHANGE | 0 | 0ns | 0ns | 0 | 1 | 0 B | -1 B | UNPARTITIONED |
-| 03:AGGREGATE | 1 | 0ns | 0ns | 0 | 1 | 20.00 KB | 10.00 MB | |
-| 02:NESTED LOOP JOIN | 1 | 61.85s | 61.85s | 283.43M | 22.50B | 3.23 MB | 0 B | CROSS JOIN, BROADCAST |
-| |--04:EXCHANGE | 1 | 26.29ms | 26.29ms | 150.00K | 150.00K | 0 B | 0 B | BROADCAST |
-| | 01:SCAN HDFS | 1 | 503.57ms | 503.57ms | 150.00K | 150.00K | 24.09 MB | 64.00 MB | tpch.customer t2 |
-| 00:SCAN HDFS | 1 | 247.59ms | 247.59ms | 2.05K | 150.00K | 24.39 MB | 64.00 MB | tpch.customer t1 |
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-]]>
-</codeblock>
- <!-- Keeping this sample output that illustrates a couple of glitches in the LIVE_SUMMARY display, hidden, to help filing JIRAs. -->
- <codeblock audience="hidden"><![CDATA[[
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-| Operator | #Hosts | Avg Time | Max Time | #Rows | Est. #Rows | Peak Mem | Est. Peak Mem | Detail |
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-| 06:AGGREGATE | 0 | 0ns | 0ns | 0 | 1 | 0 B | -1 B | FINALIZE |
-| 05:EXCHANGE | 0 | 0ns | 0ns | 0 | 1 | 0 B | -1 B | UNPARTITIONED |
-| 03:AGGREGATE | 1 | 0ns | 0ns | 0 | 1 | 20.00 KB | 10.00 MB | |
-| 02:NESTED LOOP JOIN | 1 | 91.34s | 91.34s | 419.48M | 22.50B | 3.23 MB | 0 B | CROSS JOIN, BROADCAST |
-| |--04:EXCHANGE | 1 | 26.29ms | 26.29ms | 150.00K | 150.00K | 0 B | 0 B | BROADCAST |
-| | 01:SCAN HDFS | 1 | 503.57ms | 503.57ms | 150.00K | 150.00K | 24.09 MB | 64.00 MB | tpch.customer t2 |
-| 00:SCAN HDFS | 1 | 247.63ms | 247.63ms | 3.07K | 150.00K | 24.39 MB | 64.00 MB | tpch.customer t1 |
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-| Operator | #Hosts | Avg Time | Max Time | #Rows | Est. #Rows | Peak Mem | Est. Peak Mem | Detail |
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-| 06:AGGREGATE | 0 | 0ns | 0ns | 0 | 1 | 0 B | -1 B | FINALIZE |
-| 05:EXCHANGE | 0 | 0ns | 0ns | 0 | 1 | 0 B | -1 B | UNPARTITIONED |
-| 03:AGGREGATE | 1 | 0ns | 0ns | 0 | 1 | 20.00 KB | 10.00 MB | |
-| 02:NESTED LOOP JOIN | 1 | 140.49s | 140.49s | 646.82M | 22.50B | 3.23 MB | 0 B | CROSS JOIN, BROADCAST |
-| |--04:EXCHANGE | 1 | 26.29ms | 26.29ms | 150.00K | 150.00K | 0 B | 0 B | BROADCAST |
-| | 01:SCAN HDFS | 1 | 503.57ms | 503.57ms | 150.00K | 150.00K | 24.09 MB | 64.00 MB | tpch.customer t2 |
-| 00:SCAN HDFS | 1 | 247.73ms | 247.73ms | 5.12K | 150.00K | 24.39 MB | 64.00 MB | tpch.customer t1 |
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-| Operator | #Hosts | Avg Time | Max Time | #Rows | Est. #Rows | Peak Mem | Est. Peak Mem | Detail |
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-| 06:AGGREGATE | 0 | 0ns | 0ns | 0 | 1 | 0 B | -1 B | FINALIZE |
-| 05:EXCHANGE | 0 | 0ns | 0ns | 0 | 1 | 0 B | -1 B | UNPARTITIONED |
-| 03:AGGREGATE | 1 | 0ns | 0ns | 0 | 1 | 20.00 KB | 10.00 MB | |
-| 02:NESTED LOOP JOIN | 1 | 228.96s | 228.96s | 1.06B | 22.50B | 3.23 MB | 0 B | CROSS JOIN, BROADCAST |
-| |--04:EXCHANGE | 1 | 26.29ms | 26.29ms | 150.00K | 150.00K | 0 B | 0 B | BROADCAST |
-| | 01:SCAN HDFS | 1 | 503.57ms | 503.57ms | 150.00K | 150.00K | 24.09 MB | 64.00 MB | tpch.customer t2 |
-| 00:SCAN HDFS | 1 | 247.83ms | 247.83ms | 7.17K | 150.00K | 24.39 MB | 64.00 MB | tpch.customer t1 |
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-| Operator | #Hosts | Avg Time | Max Time | #Rows | Est. #Rows | Peak Mem | Est. Peak Mem | Detail |
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-| 06:AGGREGATE | 0 | 0ns | 0ns | 0 | 1 | 0 B | -1 B | FINALIZE |
-| 05:EXCHANGE | 0 | 0ns | 0ns | 0 | 1 | 0 B | -1 B | UNPARTITIONED |
-| 03:AGGREGATE | 1 | 0ns | 0ns | 0 | 1 | 20.00 KB | 10.00 MB | |
-| 02:NESTED LOOP JOIN | 1 | 563.11s | 563.11s | 2.59B | 22.50B | 3.23 MB | 0 B | CROSS JOIN, BROADCAST |
-| |--04:EXCHANGE | 1 | 26.29ms | 26.29ms | 150.00K | 150.00K | 0 B | 0 B | BROADCAST |
-| | 01:SCAN HDFS | 1 | 503.57ms | 503.57ms | 150.00K | 150.00K | 24.09 MB | 64.00 MB | tpch.customer t2 |
-| 00:SCAN HDFS | 1 | 248.11ms | 248.11ms | 17.41K | 150.00K | 24.39 MB | 64.00 MB | tpch.customer t1 |
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-| Operator | #Hosts | Avg Time | Max Time | #Rows | Est. #Rows | Peak Mem | Est. Peak Mem | Detail |
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-| 06:AGGREGATE | 0 | 0ns | 0ns | 0 | 1 | 0 B | -1 B | FINALIZE |
-| 05:EXCHANGE | 0 | 0ns | 0ns | 0 | 1 | 0 B | -1 B | UNPARTITIONED |
-| 03:AGGREGATE | 1 | 0ns | 0ns | 0 | 1 | 20.00 KB | 10.00 MB | |
-| 02:NESTED LOOP JOIN | 1 | 985.71s | 985.71s | 4.54B | 22.50B | 3.23 MB | 0 B | CROSS JOIN, BROADCAST |
-| |--04:EXCHANGE | 1 | 26.29ms | 26.29ms | 150.00K | 150.00K | 0 B | 0 B | BROADCAST |
-| | 01:SCAN HDFS | 1 | 503.57ms | 503.57ms | 150.00K | 150.00K | 24.09 MB | 64.00 MB | tpch.customer t2 |
-| 00:SCAN HDFS | 1 | 248.49ms | 248.49ms | 30.72K | 150.00K | 24.39 MB | 64.00 MB | tpch.customer t1 |
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-| Operator | #Hosts | Avg Time | Max Time | #Rows | Est. #Rows | Peak Mem | Est. Peak Mem | Detail |
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-| 06:AGGREGATE | 0 | 0ns | 0ns | 0 | 1 | 0 B | -1 B | FINALIZE |
-| 05:EXCHANGE | 0 | 0ns | 0ns | 0 | 1 | 0 B | -1 B | UNPARTITIONED |
-| 03:AGGREGATE | 1 | 0ns | 0ns | 0 | 1 | 20.00 KB | 10.00 MB | |
-| 02:NESTED LOOP JOIN | 1 | None | None | 5.42B | 22.50B | 3.23 MB | 0 B | CROSS JOIN, BROADCAST |
-| |--04:EXCHANGE | 1 | 26.29ms | 26.29ms | 150.00K | 150.00K | 0 B | 0 B | BROADCAST |
-| | 01:SCAN HDFS | 1 | 503.57ms | 503.57ms | 150.00K | 150.00K | 24.09 MB | 64.00 MB | tpch.customer t2 |
-| 00:SCAN HDFS | 1 | 248.66ms | 248.66ms | 36.86K | 150.00K | 24.39 MB | 64.00 MB | tpch.customer t1 |
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-
-[localhost:21000] > select count(*) from customer t1 cross join customer t2;
-Query: select count(*) from customer t1 cross join customer t2
-[####################################################################################################] 100%
-+---------------------+--------+----------+----------+---------+------------+----------+---------------+-----------------------+
-| Operator | #Hosts | Avg Time | Max Time | #Rows | Est. #Rows | Peak Mem | Est. Peak Mem | Detail |
-]]>
-</codeblock>
<p
conref="../shared/impala_common.xml#common/live_progress_live_summary_asciinema"
/>
diff --git a/docs/topics/impala_mem_limit.xml b/docs/topics/impala_mem_limit.xml
index d61edf3..4fed1e1 100644
--- a/docs/topics/impala_mem_limit.xml
+++ b/docs/topics/impala_mem_limit.xml
@@ -205,17 +205,17 @@ Query: select count(distinct c_name) from customer
+------------------------+
[localhost:21000] > summary;
-+--------------+--------+----------+----------+---------+------------+----------+---------------+---------------+
-| Operator | #Hosts | Avg Time | Max Time | #Rows | Est. #Rows | Peak Mem | Est. Peak Mem | Detail |
-+--------------+--------+----------+----------+---------+------------+----------+---------------+---------------+
-| 06:AGGREGATE | 1 | 230.00ms | 230.00ms | 1 | 1 | 16.00 KB | -1 B | FINALIZE |
-| 05:EXCHANGE | 1 | 43.44us | 43.44us | 1 | 1 | 0 B | -1 B | UNPARTITIONED |
-| 02:AGGREGATE | 1 | 227.14ms | 227.14ms | 1 | 1 | 12.00 KB | 10.00 MB | |
-| 04:AGGREGATE | 1 | 126.27ms | 126.27ms | 150.00K | 150.00K | 15.17 MB | 10.00 MB | |
-| 03:EXCHANGE | 1 | 44.07ms | 44.07ms | 150.00K | 150.00K | 0 B | 0 B | HASH(c_name) |
-<b>| 01:AGGREGATE | 1 | 361.94ms | 361.94ms | 150.00K | 150.00K | 23.04 MB | 10.00 MB | |</b>
-| 00:SCAN HDFS | 1 | 43.64ms | 43.64ms | 150.00K | 150.00K | 24.19 MB | 64.00 MB | tpch.customer |
-+--------------+--------+----------+----------+---------+------------+----------+---------------+---------------+
++--------------+--------+--------+----------+----------+---------+------------+----------+---------------+---------------+
+| Operator | #Hosts | #Inst | Avg Time | Max Time | #Rows | Est. #Rows | Peak Mem | Est. Peak Mem | Detail |
++--------------+--------+--------+----------+----------+---------+------------+----------+---------------+---------------+
+| 06:AGGREGATE | 1 | 1 | 230.00ms | 230.00ms | 1 | 1 | 16.00 KB | -1 B | FINALIZE |
+| 05:EXCHANGE | 1 | 1 | 43.44us | 43.44us | 1 | 1 | 0 B | -1 B | UNPARTITIONED |
+| 02:AGGREGATE | 1 | 1 | 227.14ms | 227.14ms | 1 | 1 | 12.00 KB | 10.00 MB | |
+| 04:AGGREGATE | 1 | 1 | 126.27ms | 126.27ms | 150.00K | 150.00K | 15.17 MB | 10.00 MB | |
+| 03:EXCHANGE | 1 | 1 | 44.07ms | 44.07ms | 150.00K | 150.00K | 0 B | 0 B | HASH(c_name) |
+<b>| 01:AGGREGATE | 1 | 1 | 361.94ms | 361.94ms | 150.00K | 150.00K | 23.04 MB | 10.00 MB | |</b>
+| 00:SCAN HDFS | 1 | 1 | 43.64ms | 43.64ms | 150.00K | 150.00K | 24.19 MB | 64.00 MB | tpch.customer |
++--------------+--------+--------+----------+----------+---------+------------+----------+---------------+---------------+
[localhost:21000] > set mem_limit=15mb;
MEM_LIMIT set to 15mb