15 #ifndef IMPALA_SERVICE_QUERY_EXEC_STATE_H
16 #define IMPALA_SERVICE_QUERY_EXEC_STATE_H
24 #include "gen-cpp/Frontend_types.h"
26 #include "gen-cpp/Frontend_types.h"
28 #include <boost/thread.hpp>
29 #include <boost/unordered_set.hpp>
41 class QueryExecStateCleaner;
70 Status Exec(
const TMetadataOpRequest& exec_request);
360 void SetResultSet(
const std::vector<std::string>& results);
362 const std::vector<std::string>& col2);
364 const std::vector<std::string>& col2,
const std::vector<std::string>& col3,
365 const std::vector<std::string>& col4);
const TimestampValue & end_time() const
Status FetchRows(const int32_t max_rows, QueryResultSet *fetched_rows)
TDdlType::type ddl_type() const
void SetCreateTableAsSelectResultSet()
Coordinator * coord() const
const TExecRequest & exec_request() const
Status ExecLocalCatalogOp(const TCatalogOpRequest &catalog_op)
RuntimeProfile::EventSequence * query_events() const
boost::scoped_ptr< QuerySchedule > schedule_
Resource assignment determined by scheduler. Owned by obj_pool_.
const TQueryOptions & query_options() const
Frontend * frontend_
To get access to UpdateCatalog, LOAD, and DDL methods. Not owned.
int num_rows_fetched() const
void set_result_metadata(const TResultSetMetadata &md)
const std::vector< std::string > & GetAnalysisWarnings() const
const TUniqueId & session_id() const
std::vector< ExprContext * > output_expr_ctxs_
TUniqueId parent_query_id() const
Returns 0:0 if this is a root query.
const std::string & connected_user() const
bool fetched_rows() const
void UpdateQueryState(beeswax::QueryState::type query_state)
beeswax::QueryState::type query_state_
Status UpdateTableAndColumnStats()
const std::string & default_db() const
bool returns_result_set()
void WaitAsync()
Calls Wait() asynchronously in a thread and returns immediately.
boost::scoped_ptr< Thread > wait_thread_
Thread for asynchronously running Wait().
boost::scoped_ptr< Thread > child_queries_thread_
boost::shared_ptr< SessionState > session_
Session that this query is from.
void set_query_state(beeswax::QueryState::type state)
TResultSetMetadata result_metadata_
const std::string & effective_user() const
boost::scoped_ptr< RuntimeState > local_runtime_state_
local runtime_state_ in case we don't have a coord_
int64_t last_active_time_
boost::scoped_ptr< Coordinator > coord_
not set for ddl queries, or queries with "limit 0"
int64_t result_cache_max_size_
Max size of the result_cache_ in number of rows. A value <= 0 means no caching.
RuntimeProfile::Counter * row_materialization_timer_
QuerySchedule * schedule()
boost::mutex fetch_rows_lock_
Status WaitForChildQueries()
Status SetResultCache(QueryResultSet *cache, int64_t max_size)
boost::mutex expiration_data_lock_
void SetResultSet(const std::vector< std::string > &results)
Status GetRowValue(TupleRow *row, std::vector< void * > *result, std::vector< int > *scales)
boost::scoped_ptr< QueryResultSet > result_cache_
bool is_active() const
Returns true if Impala is actively processing this query.
Status FetchRowsInternal(const int32_t max_rows, QueryResultSet *fetched_rows)
const TimestampValue & start_time() const
const RuntimeProfile & summary_profile() const
const TUniqueId & query_id() const
Status ExecQueryOrDmlRequest(const TQueryExecRequest &query_exec_request)
Status ExecLoadDataRequest()
Executes a LOAD DATA.
ImpalaServer::SessionState * session() const
Status WaitInternal()
Core logic of Wait(). Does not update query_state_/status_.
RuntimeProfile summary_profile_
const beeswax::QueryState::type query_state() const
RuntimeProfile::Counter * client_wait_timer_
Tracks how long we are idle waiting for a client to fetch rows.
RuntimeProfile * summary_profile()
RuntimeProfile::EventSequence * query_events_
RowBatch * current_batch_
boost::mutex * fetch_rows_lock()
Status UpdateQueryStatus(const Status &status)
const std::string & do_as_user() const
boost::scoped_ptr< std::vector< TResultRow > > request_result_set_
TStmtType::type stmt_type() const
TExecRequest exec_request_
const std::string & sql_stmt() const
const Status & query_status() const
Status child_queries_status_
int64_t last_active() const
Status Exec(TExecRequest *exec_request)
const TQueryCtx query_ctx_
TimestampValue start_time_
Start/end time of the query.
const TResultSetMetadata * result_metadata()
std::vector< ChildQuery > child_queries_
List of child queries to be executed on behalf of this query.
void Cancel(const Status *cause=NULL)
boost::scoped_ptr< CatalogOpExecutor > catalog_op_executor_
Runs statements that query or modify the catalog via the CatalogService.
const RuntimeProfile & profile() const
Status UpdateCatalog()
Gather and publish all required updates to the metastore.
RuntimeProfile server_profile_
QueryExecState(const TQueryCtx &query_ctx, ExecEnv *exec_env, Frontend *frontend, ImpalaServer *server, boost::shared_ptr< ImpalaServer::SessionState > session)
MonotonicStopWatch client_wait_sw_
Timer to track idle time for the above counter.
TCatalogOpType::type catalog_op_type() const
ImpalaServer * parent_server_
TSessionType::type session_type() const
void ExecChildQueriesAsync()