OmniSciDB  c1a53651b2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DdlCommandExecutor Class Reference

#include <DdlCommandExecutor.h>

+ Collaboration diagram for DdlCommandExecutor:

Public Member Functions

 DdlCommandExecutor (const std::string &ddl_statement, std::shared_ptr< Catalog_Namespace::SessionInfo const > session_ptr)
 
ExecutionResult execute (bool read_only_mode)
 
bool isShowUserSessions () const
 
bool isShowQueries () const
 
bool isKillQuery () const
 
bool isAlterSystemClear () const
 
bool isAlterSessionSet () const
 
std::string returnCacheType () const
 
const std::string getTargetQuerySessionToKill () const
 
DistributedExecutionDetails getDistributedExecutionDetails () const
 
const std::string commandStr () const
 
std::pair< std::string,
std::string > 
getSessionParameter () const
 

Private Attributes

std::string ddl_statement_
 
std::string ddl_command_
 
std::unique_ptr< DdlCommandDataddl_data_
 
std::shared_ptr
< Catalog_Namespace::SessionInfo
const > 
session_ptr_
 

Detailed Description

Definition at line 313 of file DdlCommandExecutor.h.

Constructor & Destructor Documentation

DdlCommandExecutor::DdlCommandExecutor ( const std::string &  ddl_statement,
std::shared_ptr< Catalog_Namespace::SessionInfo const >  session_ptr 
)

Definition at line 310 of file DdlCommandExecutor.cpp.

References CHECK, ddl_command_, ddl_data_, ddl_statement_, and VLOG.

313  : session_ptr_(session_ptr) {
314  CHECK(!ddl_statement.empty());
315  ddl_statement_ = ddl_statement;
316 
317  // parse the incoming query,
318  // cache the parsed rapidjson object inside a DdlCommandDataImpl
319  // store the "abstract/base class" reference in ddl_data_
320  DdlCommandDataImpl* ddl_query_data = new DdlCommandDataImpl(ddl_statement);
321  ddl_data_ = std::unique_ptr<DdlCommandData>(ddl_query_data);
322 
323  VLOG(2) << "Parsing JSON DDL from Calcite: " << ddl_statement;
324  auto& ddl_query = ddl_query_data->query();
325  CHECK(ddl_query.IsObject()) << ddl_statement;
326  CHECK(ddl_query.HasMember("payload"));
327  CHECK(ddl_query["payload"].IsObject());
328  const auto& payload = ddl_query["payload"].GetObject();
329  CHECK(payload.HasMember("command"));
330  CHECK(payload["command"].IsString());
331  ddl_command_ = payload["command"].GetString();
332 }
std::unique_ptr< DdlCommandData > ddl_data_
std::shared_ptr< Catalog_Namespace::SessionInfo const > session_ptr_
#define CHECK(condition)
Definition: Logger.h:291
#define VLOG(n)
Definition: Logger.h:387

Member Function Documentation

const std::string DdlCommandExecutor::commandStr ( ) const

Returns command string, can be useful for logging, conversion

Definition at line 629 of file DdlCommandExecutor.cpp.

References ddl_command_.

Referenced by DBHandler::executeDdl().

629  {
630  return ddl_command_;
631 }

+ Here is the caller graph for this function:

ExecutionResult DdlCommandExecutor::execute ( bool  read_only_mode)

Parses given JSON string and routes resulting payload to appropriate DDL command class for execution.

Parameters
returnExecutionResult of DDL command execution (if applicable)

Definition at line 334 of file DdlCommandExecutor.cpp.

References ddl_command_, ddl_data_, Parser::AlterTableStmt::delegate(), legacylockmgr::ExecutorOuterLock, anonymous_namespace{DdlCommandExecutor.cpp}::extractPayload(), legacylockmgr::LockMgr< MutexType, KeyType >::getMutex(), run_benchmark_import::result, session_ptr_, and UNREACHABLE.

Referenced by DBHandler::executeDdl(), heavydb.cursor.Cursor::executemany(), and QueryRunner::QueryRunner::runDDLStatement().

334  {
336 
337  // the following commands use parser node locking to ensure safe concurrent access
338  if (ddl_command_ == "CREATE_TABLE") {
339  auto create_table_stmt = Parser::CreateTableStmt(extractPayload(*ddl_data_));
340  create_table_stmt.execute(*session_ptr_, read_only_mode);
341  return result;
342  } else if (ddl_command_ == "CREATE_VIEW") {
343  auto create_view_stmt = Parser::CreateViewStmt(extractPayload(*ddl_data_));
344  create_view_stmt.execute(*session_ptr_, read_only_mode);
345  return result;
346  } else if (ddl_command_ == "DROP_TABLE") {
347  auto drop_table_stmt = Parser::DropTableStmt(extractPayload(*ddl_data_));
348  drop_table_stmt.execute(*session_ptr_, read_only_mode);
349  return result;
350  } else if (ddl_command_ == "DROP_VIEW") {
351  auto drop_view_stmt = Parser::DropViewStmt(extractPayload(*ddl_data_));
352  drop_view_stmt.execute(*session_ptr_, read_only_mode);
353  return result;
354  } else if (ddl_command_ == "RENAME_TABLE") {
355  auto rename_table_stmt = Parser::RenameTableStmt(extractPayload(*ddl_data_));
356  rename_table_stmt.execute(*session_ptr_, read_only_mode);
357  return result;
358  } else if (ddl_command_ == "ALTER_TABLE") {
360  if (stmt != nullptr) {
361  stmt->execute(*session_ptr_, read_only_mode);
362  }
363  return result;
364  } else if (ddl_command_ == "TRUNCATE_TABLE") {
365  auto truncate_table_stmt = Parser::TruncateTableStmt(extractPayload(*ddl_data_));
366  truncate_table_stmt.execute(*session_ptr_, read_only_mode);
367  return result;
368  } else if (ddl_command_ == "DUMP_TABLE") {
369  auto dump_table_stmt = Parser::DumpTableStmt(extractPayload(*ddl_data_));
370  dump_table_stmt.execute(*session_ptr_, read_only_mode);
371  return result;
372  } else if (ddl_command_ == "RESTORE_TABLE") {
373  auto restore_table_stmt = Parser::RestoreTableStmt(extractPayload(*ddl_data_));
374  restore_table_stmt.execute(*session_ptr_, read_only_mode);
375  return result;
376  } else if (ddl_command_ == "OPTIMIZE_TABLE") {
377  auto optimize_table_stmt = Parser::OptimizeTableStmt(extractPayload(*ddl_data_));
378  optimize_table_stmt.execute(*session_ptr_, read_only_mode);
379  return result;
380  } else if (ddl_command_ == "COPY_TABLE") {
381  auto copy_table_stmt = Parser::CopyTableStmt(extractPayload(*ddl_data_));
382  copy_table_stmt.execute(*session_ptr_, read_only_mode);
383  return result;
384  } else if (ddl_command_ == "EXPORT_QUERY") {
385  auto export_query_stmt = Parser::ExportQueryStmt(extractPayload(*ddl_data_));
386  export_query_stmt.execute(*session_ptr_, read_only_mode);
387  return result;
388  } else if (ddl_command_ == "CREATE_DB") {
389  auto create_db_stmt = Parser::CreateDBStmt(extractPayload(*ddl_data_));
390  create_db_stmt.execute(*session_ptr_, read_only_mode);
391  return result;
392  } else if (ddl_command_ == "DROP_DB") {
393  auto drop_db_stmt = Parser::DropDBStmt(extractPayload(*ddl_data_));
394  drop_db_stmt.execute(*session_ptr_, read_only_mode);
395  return result;
396  } else if (ddl_command_ == "CREATE_USER") {
397  auto create_user_stmt = Parser::CreateUserStmt(extractPayload(*ddl_data_));
398  create_user_stmt.execute(*session_ptr_, read_only_mode);
399  return result;
400  } else if (ddl_command_ == "DROP_USER") {
401  auto drop_user_stmt = Parser::DropUserStmt(extractPayload(*ddl_data_));
402  drop_user_stmt.execute(*session_ptr_, read_only_mode);
403  return result;
404  } else if (ddl_command_ == "ALTER_USER") {
405  auto alter_user_stmt = Parser::AlterUserStmt(extractPayload(*ddl_data_));
406  alter_user_stmt.execute(*session_ptr_, read_only_mode);
407  return result;
408  } else if (ddl_command_ == "RENAME_USER") {
409  auto rename_user_stmt = Parser::RenameUserStmt(extractPayload(*ddl_data_));
410  rename_user_stmt.execute(*session_ptr_, read_only_mode);
411  return result;
412  } else if (ddl_command_ == "CREATE_ROLE") {
413  auto create_role_stmt = Parser::CreateRoleStmt(extractPayload(*ddl_data_));
414  create_role_stmt.execute(*session_ptr_, read_only_mode);
415  return result;
416  } else if (ddl_command_ == "DROP_ROLE") {
417  auto drop_role_stmt = Parser::DropRoleStmt(extractPayload(*ddl_data_));
418  drop_role_stmt.execute(*session_ptr_, read_only_mode);
419  return result;
420  } else if (ddl_command_ == "GRANT_ROLE") {
421  auto grant_role_stmt = Parser::GrantRoleStmt(extractPayload(*ddl_data_));
422  grant_role_stmt.execute(*session_ptr_, read_only_mode);
423  return result;
424  } else if (ddl_command_ == "REVOKE_ROLE") {
425  auto revoke_role_stmt = Parser::RevokeRoleStmt(extractPayload(*ddl_data_));
426  revoke_role_stmt.execute(*session_ptr_, read_only_mode);
427  return result;
428  } else if (ddl_command_ == "GRANT_PRIVILEGE") {
429  auto grant_privilege_stmt = Parser::GrantPrivilegesStmt(extractPayload(*ddl_data_));
430  grant_privilege_stmt.execute(*session_ptr_, read_only_mode);
431  return result;
432  } else if (ddl_command_ == "REVOKE_PRIVILEGE") {
433  auto revoke_privileges_stmt =
435  revoke_privileges_stmt.execute(*session_ptr_, read_only_mode);
436  return result;
437  } else if (ddl_command_ == "CREATE_DATAFRAME") {
438  auto create_dataframe_stmt = Parser::CreateDataframeStmt(extractPayload(*ddl_data_));
439  create_dataframe_stmt.execute(*session_ptr_, read_only_mode);
440  return result;
441  } else if (ddl_command_ == "VALIDATE_SYSTEM") {
442  // VALIDATE should have been excuted in outer context before it reaches here
443  UNREACHABLE();
444  } else if (ddl_command_ == "REFRESH_FOREIGN_TABLES") {
445  result =
446  RefreshForeignTablesCommand{*ddl_data_, session_ptr_}.execute(read_only_mode);
447  return result;
448  }
449 
450  // the following commands require a global unique lock until proper table locking has
451  // been implemented and/or verified
452  auto execute_write_lock =
456  // TODO(vancouver): add appropriate table locking
457 
458  if (ddl_command_ == "CREATE_SERVER") {
459  result = CreateForeignServerCommand{*ddl_data_, session_ptr_}.execute(read_only_mode);
460  } else if (ddl_command_ == "DROP_SERVER") {
461  result = DropForeignServerCommand{*ddl_data_, session_ptr_}.execute(read_only_mode);
462  } else if (ddl_command_ == "CREATE_FOREIGN_TABLE") {
463  result = CreateForeignTableCommand{*ddl_data_, session_ptr_}.execute(read_only_mode);
464  } else if (ddl_command_ == "DROP_FOREIGN_TABLE") {
465  result = DropForeignTableCommand{*ddl_data_, session_ptr_}.execute(read_only_mode);
466  } else if (ddl_command_ == "SHOW_TABLES") {
467  result = ShowTablesCommand{*ddl_data_, session_ptr_}.execute(read_only_mode);
468  } else if (ddl_command_ == "SHOW_TABLE_DETAILS") {
469  result = ShowTableDetailsCommand{*ddl_data_, session_ptr_}.execute(read_only_mode);
470  } else if (ddl_command_ == "SHOW_CREATE_TABLE") {
471  result = ShowCreateTableCommand{*ddl_data_, session_ptr_}.execute(read_only_mode);
472  } else if (ddl_command_ == "SHOW_DATABASES") {
473  result = ShowDatabasesCommand{*ddl_data_, session_ptr_}.execute(read_only_mode);
474  } else if (ddl_command_ == "SHOW_SERVERS") {
475  result = ShowForeignServersCommand{*ddl_data_, session_ptr_}.execute(read_only_mode);
476  } else if (ddl_command_ == "SHOW_CREATE_SERVER") {
477  result = ShowCreateServerCommand{*ddl_data_, session_ptr_}.execute(read_only_mode);
478  } else if (ddl_command_ == "SHOW_FUNCTIONS") {
479  result = ShowFunctionsCommand{*ddl_data_, session_ptr_}.execute(read_only_mode);
480  } else if (ddl_command_ == "SHOW_RUNTIME_FUNCTIONS") {
481  result =
482  ShowRuntimeFunctionsCommand{*ddl_data_, session_ptr_}.execute(read_only_mode);
483  } else if (ddl_command_ == "SHOW_TABLE_FUNCTIONS") {
484  result = ShowTableFunctionsCommand{*ddl_data_, session_ptr_}.execute(read_only_mode);
485  } else if (ddl_command_ == "SHOW_RUNTIME_TABLE_FUNCTIONS") {
487  read_only_mode);
488  } else if (ddl_command_ == "ALTER_SERVER") {
489  result = AlterForeignServerCommand{*ddl_data_, session_ptr_}.execute(read_only_mode);
490  } else if (ddl_command_ == "ALTER_DATABASE") {
491  result = AlterDatabaseCommand{*ddl_data_, session_ptr_}.execute(read_only_mode);
492  } else if (ddl_command_ == "ALTER_FOREIGN_TABLE") {
493  result = AlterForeignTableCommand{*ddl_data_, session_ptr_}.execute(read_only_mode);
494  } else if (ddl_command_ == "SHOW_DISK_CACHE_USAGE") {
495  result = ShowDiskCacheUsageCommand{*ddl_data_, session_ptr_}.execute(read_only_mode);
496  } else if (ddl_command_ == "SHOW_USER_DETAILS") {
497  result = ShowUserDetailsCommand{*ddl_data_, session_ptr_}.execute(read_only_mode);
498  } else if (ddl_command_ == "SHOW_ROLES") {
499  result = ShowRolesCommand{*ddl_data_, session_ptr_}.execute(read_only_mode);
500  } else if (ddl_command_ == "REASSIGN_OWNED") {
501  result = ReassignOwnedCommand{*ddl_data_, session_ptr_}.execute(read_only_mode);
502  } else {
503  throw std::runtime_error("Unsupported DDL command");
504  }
505 
506  return result;
507 }
static std::shared_ptr< WrapperType< MutexType > > getMutex(const LockType lockType, const KeyType &key)
std::unique_ptr< DdlCommandData > ddl_data_
#define UNREACHABLE()
Definition: Logger.h:337
const rapidjson::Value & extractPayload(const DdlCommandData &ddl_data)
std::unique_lock< T > unique_lock
std::shared_ptr< Catalog_Namespace::SessionInfo const > session_ptr_
static std::unique_ptr< Parser::DDLStmt > delegate(const rapidjson::Value &payload)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DistributedExecutionDetails DdlCommandExecutor::getDistributedExecutionDetails ( ) const

Returns an object indicating where command execution should take place and how results should be aggregated for distributed setups.

Definition at line 564 of file DdlCommandExecutor.cpp.

References DistributedExecutionDetails::aggregation_type, AGGREGATOR_ONLY, ALL_NODES, CHECK, ddl_command_, ddl_data_, DistributedExecutionDetails::execution_location, anonymous_namespace{DdlCommandExecutor.cpp}::extractPayload(), LEAVES_ONLY, NONE, and UNION.

564  {
565  DistributedExecutionDetails execution_details;
566  if (ddl_command_ == "CREATE_DATAFRAME" || ddl_command_ == "RENAME_TABLE" ||
567  ddl_command_ == "ALTER_TABLE" || ddl_command_ == "CREATE_TABLE" ||
568  ddl_command_ == "DROP_TABLE" || ddl_command_ == "TRUNCATE_TABLE" ||
569  ddl_command_ == "DUMP_TABLE" || ddl_command_ == "RESTORE_TABLE" ||
570  ddl_command_ == "OPTIMIZE_TABLE" || ddl_command_ == "CREATE_VIEW" ||
571  ddl_command_ == "DROP_VIEW" || ddl_command_ == "CREATE_DB" ||
572  ddl_command_ == "DROP_DB" || ddl_command_ == "ALTER_DATABASE" ||
573  ddl_command_ == "CREATE_USER" || ddl_command_ == "DROP_USER" ||
574  ddl_command_ == "ALTER_USER" || ddl_command_ == "RENAME_USER" ||
575  ddl_command_ == "CREATE_ROLE" || ddl_command_ == "DROP_ROLE" ||
576  ddl_command_ == "GRANT_ROLE" || ddl_command_ == "REVOKE_ROLE" ||
577  ddl_command_ == "REASSIGN_OWNED" || ddl_command_ == "CREATE_POLICY" ||
578  ddl_command_ == "DROP_POLICY" || ddl_command_ == "CREATE_SERVER" ||
579  ddl_command_ == "DROP_SERVER" || ddl_command_ == "CREATE_FOREIGN_TABLE" ||
580  ddl_command_ == "DROP_FOREIGN_TABLE" || ddl_command_ == "CREATE_USER_MAPPING" ||
581  ddl_command_ == "DROP_USER_MAPPING" || ddl_command_ == "ALTER_FOREIGN_TABLE" ||
582  ddl_command_ == "ALTER_SERVER" || ddl_command_ == "REFRESH_FOREIGN_TABLES" ||
583  ddl_command_ == "ALTER_SYSTEM_CLEAR") {
584  // group user/role/db commands
586  execution_details.aggregation_type = AggregationType::NONE;
587  } else if (ddl_command_ == "GRANT_PRIVILEGE" || ddl_command_ == "REVOKE_PRIVILEGE") {
588  auto& ddl_payload = extractPayload(*ddl_data_);
589  CHECK(ddl_payload.HasMember("type"));
590  const std::string& targetType = ddl_payload["type"].GetString();
591  if (targetType == "DASHBOARD") {
592  // dashboard commands should run on Aggregator alone
594  execution_details.aggregation_type = AggregationType::NONE;
595  } else {
597  execution_details.aggregation_type = AggregationType::NONE;
598  }
599 
600  } else if (ddl_command_ == "SHOW_TABLE_DETAILS" ||
601  ddl_command_ == "SHOW_DISK_CACHE_USAGE") {
603  execution_details.aggregation_type = AggregationType::UNION;
604  } else {
605  // Commands that fall here : COPY_TABLE, EXPORT_QUERY, etc.
607  execution_details.aggregation_type = AggregationType::NONE;
608  }
609  return execution_details;
610 }
std::unique_ptr< DdlCommandData > ddl_data_
const rapidjson::Value & extractPayload(const DdlCommandData &ddl_data)
#define CHECK(condition)
Definition: Logger.h:291
ExecutionLocation execution_location

+ Here is the call graph for this function:

std::pair< std::string, std::string > DdlCommandExecutor::getSessionParameter ( ) const

Returns name and value of a Session parameter

Definition at line 529 of file DdlCommandExecutor.cpp.

References CHECK, ddl_data_, anonymous_namespace{DdlCommandExecutor.cpp}::extractPayload(), and to_upper().

Referenced by DBHandler::executeDdl().

529  {
530  enum SetParameterType { String_t, Numeric_t };
531  static const std::unordered_map<std::string, SetParameterType>
532  session_set_parameters_map = {{"EXECUTOR_DEVICE", SetParameterType::String_t},
533  {"CURRENT_DATABASE", SetParameterType::String_t}};
534 
535  auto& ddl_payload = extractPayload(*ddl_data_);
536  CHECK(ddl_payload.HasMember("sessionParameter"));
537  CHECK(ddl_payload["sessionParameter"].IsString());
538  CHECK(ddl_payload.HasMember("parameterValue"));
539  CHECK(ddl_payload["parameterValue"].IsString());
540  std::string parameter_name = to_upper(ddl_payload["sessionParameter"].GetString());
541  std::string parameter_value = ddl_payload["parameterValue"].GetString();
542 
543  const auto param_it = session_set_parameters_map.find(parameter_name);
544  if (param_it == session_set_parameters_map.end()) {
545  throw std::runtime_error(parameter_name + " is not a settable session parameter.");
546  }
547  if (param_it->second == SetParameterType::Numeric_t) {
548  if (!std::regex_match(parameter_value, std::regex("[(-|+)|][0-9]+"))) {
549  throw std::runtime_error("The value of session parameter " + param_it->first +
550  " should be a numeric.");
551  }
552  }
553  return {parameter_name, parameter_value};
554 }
std::unique_ptr< DdlCommandData > ddl_data_
const rapidjson::Value & extractPayload(const DdlCommandData &ddl_data)
std::string to_upper(const std::string &str)
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const std::string DdlCommandExecutor::getTargetQuerySessionToKill ( ) const

Returns target query session if this command is KILL QUERY

Definition at line 612 of file DdlCommandExecutor.cpp.

References CHECK, ddl_data_, anonymous_namespace{DdlCommandExecutor.cpp}::extractPayload(), and isKillQuery().

Referenced by DBHandler::executeDdl().

612  {
613  // caller should check whether DDL indicates KillQuery request
614  // i.e., use isKillQuery() before calling this function
615  auto& ddl_payload = extractPayload(*ddl_data_);
616  CHECK(isKillQuery());
617  CHECK(ddl_payload.HasMember("querySession"));
618  const std::string& query_session = ddl_payload["querySession"].GetString();
619  // regex matcher for public_session: start_time{3}-session_id{4} (Example:819-4RDo)
620  boost::regex session_id_regex{R"([0-9]{3}-[a-zA-Z0-9]{4})",
621  boost::regex::extended | boost::regex::icase};
622  if (!boost::regex_match(query_session, session_id_regex)) {
623  throw std::runtime_error(
624  "Please provide the correct session ID of the query that you want to interrupt.");
625  }
626  return query_session;
627 }
std::unique_ptr< DdlCommandData > ddl_data_
const rapidjson::Value & extractPayload(const DdlCommandData &ddl_data)
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool DdlCommandExecutor::isAlterSessionSet ( ) const

Returns true if this command is ALTER SESSION SET

Definition at line 525 of file DdlCommandExecutor.cpp.

References ddl_command_.

Referenced by DBHandler::executeDdl().

525  {
526  return (ddl_command_ == "ALTER_SESSION_SET");
527 }

+ Here is the caller graph for this function:

bool DdlCommandExecutor::isAlterSystemClear ( ) const

Returns true if this command is ALTER SYSTEM CLEAR

Definition at line 521 of file DdlCommandExecutor.cpp.

References ddl_command_.

Referenced by DBHandler::executeDdl().

521  {
522  return (ddl_command_ == "ALTER_SYSTEM_CLEAR");
523 }

+ Here is the caller graph for this function:

bool DdlCommandExecutor::isKillQuery ( ) const

Returns true if this command is KILL QUERY

Definition at line 517 of file DdlCommandExecutor.cpp.

References ddl_command_.

Referenced by DBHandler::executeDdl(), and getTargetQuerySessionToKill().

517  {
518  return (ddl_command_ == "KILL_QUERY");
519 }

+ Here is the caller graph for this function:

bool DdlCommandExecutor::isShowQueries ( ) const

Returns true if this command is SHOW QUERIES

Definition at line 513 of file DdlCommandExecutor.cpp.

References ddl_command_.

Referenced by DBHandler::executeDdl().

513  {
514  return (ddl_command_ == "SHOW_QUERIES");
515 }

+ Here is the caller graph for this function:

bool DdlCommandExecutor::isShowUserSessions ( ) const

Returns true if this command is SHOW USER SESSIONS

Definition at line 509 of file DdlCommandExecutor.cpp.

References ddl_command_.

Referenced by DBHandler::executeDdl().

509  {
510  return (ddl_command_ == "SHOW_USER_SESSIONS");
511 }

+ Here is the caller graph for this function:

std::string DdlCommandExecutor::returnCacheType ( ) const

Returns which kind of caches to clear if ALTER SYSTEM CLEAR

Definition at line 556 of file DdlCommandExecutor.cpp.

References CHECK, ddl_command_, ddl_data_, and anonymous_namespace{DdlCommandExecutor.cpp}::extractPayload().

Referenced by DBHandler::executeDdl().

556  {
557  CHECK(ddl_command_ == "ALTER_SYSTEM_CLEAR");
558  auto& ddl_payload = extractPayload(*ddl_data_);
559  CHECK(ddl_payload.HasMember("cacheType"));
560  CHECK(ddl_payload["cacheType"].IsString());
561  return ddl_payload["cacheType"].GetString();
562 }
std::unique_ptr< DdlCommandData > ddl_data_
const rapidjson::Value & extractPayload(const DdlCommandData &ddl_data)
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

std::unique_ptr<DdlCommandData> DdlCommandExecutor::ddl_data_
private
std::string DdlCommandExecutor::ddl_statement_
private

Definition at line 379 of file DdlCommandExecutor.h.

Referenced by DdlCommandExecutor().

std::shared_ptr<Catalog_Namespace::SessionInfo const> DdlCommandExecutor::session_ptr_
private

Definition at line 382 of file DdlCommandExecutor.h.

Referenced by execute().


The documentation for this class was generated from the following files: