OmniSciDB  8a228a1076
Parser Namespace Reference

Namespaces

 anonymous_namespace{ParserNode.cpp}
 

Classes

class  AddColumnStmt
 
class  AlterUserStmt
 
class  ArrayLiteral
 
class  Assignment
 
class  BetweenExpr
 
class  CardinalityExpr
 
class  CaseExpr
 
struct  CaseSensitiveValidate
 
class  CastExpr
 
class  CharLengthExpr
 
class  CheckDef
 
class  ColumnConstraintDef
 
class  ColumnDef
 
class  ColumnRef
 
class  CompressDef
 
class  CopyTableStmt
 
class  CreateDataframeStmt
 
class  CreateDBStmt
 
class  CreateRoleStmt
 
class  CreateTableAsSelectStmt
 
class  CreateTableBaseStmt
 
class  CreateTableStmt
 
class  CreateUserStmt
 
class  CreateViewStmt
 
class  DDLStmt
 
struct  DefaultValidate
 
struct  DefaultValidate< IntLiteral >
 
struct  DefaultValidate< StringLiteral >
 
class  DeleteStmt
 
struct  DistributedConnector
 
class  DMLStmt
 
class  DoubleLiteral
 
class  DropColumnStmt
 
class  DropDBStmt
 
class  DropRoleStmt
 
class  DropTableStmt
 
class  DropUserStmt
 
class  DropViewStmt
 
class  DumpRestoreTableStmtBase
 
class  DumpTableStmt
 
class  ExistsExpr
 
class  ExportQueryStmt
 
class  Expr
 
class  ExprPair
 
class  FixedPtLiteral
 
class  FloatLiteral
 
class  ForeignKeyDef
 
class  FunctionRef
 
class  GrantPrivilegesStmt
 
class  GrantRoleStmt
 
class  InExpr
 
class  InsertIntoTableAsSelectStmt
 
class  InsertStmt
 
class  InsertValuesStmt
 
class  InSubquery
 
class  IntLiteral
 
class  InValues
 
class  IsNullExpr
 
class  LikeExpr
 
class  LikelihoodExpr
 
class  Literal
 
struct  LocalConnector
 
class  NameValueAssign
 
class  Node
 
class  NullLiteral
 
class  OperExpr
 
class  OptimizeTableStmt
 
class  OrderSpec
 
class  QueryExpr
 
class  QuerySpec
 
class  RegexpExpr
 
class  RenameColumnStmt
 
class  RenameDatabaseStmt
 
class  RenameTableStmt
 
class  RenameUserStmt
 
class  RestoreTableStmt
 
class  RevokePrivilegesStmt
 
class  RevokeRoleStmt
 
class  SelectEntry
 
class  SelectStmt
 
class  ShardKeyDef
 
class  SharedDictionaryDef
 
struct  ShouldInvalidateSessionsByDB
 
struct  ShouldInvalidateSessionsByDB< DropDBStmt >
 
struct  ShouldInvalidateSessionsByDB< RenameDatabaseStmt >
 
struct  ShouldInvalidateSessionsByUser
 
struct  ShouldInvalidateSessionsByUser< DropUserStmt >
 
struct  ShouldInvalidateSessionsByUser< RenameUserStmt >
 
class  ShowCreateTableStmt
 
class  ShowPrivilegesStmt
 
class  SQLType
 
class  Stmt
 
class  StringLiteral
 
class  SubqueryExpr
 
class  TableConstraintDef
 
class  TableElement
 
class  TableRef
 
class  TimestampLiteral
 
class  TrackedListPtr
 
class  TrackedPtr
 
class  TruncateTableStmt
 
class  UnionQuery
 
class  UniqueDef
 
class  UpdateStmt
 
class  UserLiteral
 
class  ValidateStmt
 

Functions

template<typename DDLSTMT >
auto parseDDL (const std::string &stmt_type, const std::string &stmt_str)
 
std::shared_ptr< ResultSetgetResultSet (QueryStateProxy query_state_proxy, const std::string select_stmt, std::vector< TargetMetaInfo > &targets, bool validate_only=false, std::vector< size_t > outer_fragment_indices={})
 
void check_alter_table_privilege (const Catalog_Namespace::SessionInfo &session, const TableDescriptor *td)
 
std::vector< std::string > splitObjectHierName (const std::string &hierName)
 
std::string extractObjectNameFromHierName (const std::string &objectHierName, const std::string &objectType, const Catalog_Namespace::Catalog &cat)
 
static std::pair< AccessPrivileges, DBObjectTypeparseStringPrivs (const std::string &privs, const DBObjectType &objectType, const std::string &object_name)
 
static DBObject createObject (const std::string &objectName, DBObjectType objectType)
 
static void checkStringLiteral (const std::string &option_name, const std::unique_ptr< NameValueAssign > &p)
 
static bool readBooleanLiteral (const std::string &option_name, const std::unique_ptr< NameValueAssign > &p)
 
void parser_slistval_to_vector (std::list< std::string *> *l, std::vector< std::string > &v)
 

Function Documentation

◆ check_alter_table_privilege()

void Parser::check_alter_table_privilege ( const Catalog_Namespace::SessionInfo session,
const TableDescriptor td 
)

Definition at line 3196 of file ParserNode.cpp.

References AccessPrivileges::ALTER_TABLE, Catalog_Namespace::SessionInfo::get_currentUser(), Catalog_Namespace::SessionInfo::getCatalog(), Catalog_Namespace::UserMetadata::isSuper, DBObject::loadKey(), DBObject::setPrivileges(), TableDBObjectType, TableDescriptor::tableName, TableDescriptor::userId, and Catalog_Namespace::UserMetadata::userId.

Referenced by Parser::AddColumnStmt::check_executable(), Parser::RenameTableStmt::execute(), Parser::RenameColumnStmt::execute(), and Parser::DropColumnStmt::execute().

3197  {
3198  if (session.get_currentUser().isSuper ||
3199  session.get_currentUser().userId == td->userId) {
3200  return;
3201  }
3202  std::vector<DBObject> privObjects;
3203  DBObject dbObject(td->tableName, TableDBObjectType);
3204  dbObject.loadKey(session.getCatalog());
3205  dbObject.setPrivileges(AccessPrivileges::ALTER_TABLE);
3206  privObjects.push_back(dbObject);
3207  if (!SysCatalog::instance().checkPrivileges(session.get_currentUser(), privObjects)) {
3208  throw std::runtime_error("Current user does not have the privilege to alter table: " +
3209  td->tableName);
3210  }
3211 }
std::string tableName
static const AccessPrivileges ALTER_TABLE
Definition: DBObject.h:166
const UserMetadata & get_currentUser() const
Definition: SessionInfo.h:68
Catalog & getCatalog() const
Definition: SessionInfo.h:65
std::atomic< bool > isSuper
Definition: SysCatalog.h:96
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkStringLiteral()

static void Parser::checkStringLiteral ( const std::string &  option_name,
const std::unique_ptr< NameValueAssign > &  p 
)
static

Definition at line 4680 of file ParserNode.cpp.

References CHECK.

Referenced by Parser::CreateDBStmt::execute(), Parser::CreateUserStmt::execute(), and Parser::AlterUserStmt::execute().

4681  {
4682  CHECK(p);
4683  if (!dynamic_cast<const StringLiteral*>(p->get_value())) {
4684  throw std::runtime_error(option_name + " option must be a string literal.");
4685  }
4686 }
#define CHECK(condition)
Definition: Logger.h:197
+ Here is the caller graph for this function:

◆ createObject()

static DBObject Parser::createObject ( const std::string &  objectName,
DBObjectType  objectType 
)
static

Definition at line 4111 of file ParserNode.cpp.

References DashboardDBObjectType.

Referenced by Parser::GrantPrivilegesStmt::execute(), Parser::RevokePrivilegesStmt::execute(), and Parser::ShowPrivilegesStmt::execute().

4111  {
4112  if (objectType == DashboardDBObjectType) {
4113  int32_t dashboard_id = -1;
4114  if (!objectName.empty()) {
4115  try {
4116  dashboard_id = stoi(objectName);
4117  } catch (const std::exception&) {
4118  throw std::runtime_error(
4119  "Privileges on dashboards should be changed via integer dashboard ID");
4120  }
4121  }
4122  return DBObject(dashboard_id, objectType);
4123  } else {
4124  return DBObject(objectName, objectType);
4125  }
4126 }
+ Here is the caller graph for this function:

◆ extractObjectNameFromHierName()

std::string Parser::extractObjectNameFromHierName ( const std::string &  objectHierName,
const std::string &  objectType,
const Catalog_Namespace::Catalog cat 
)

Definition at line 3982 of file ParserNode.cpp.

References splitObjectHierName().

Referenced by Parser::GrantPrivilegesStmt::execute(), Parser::RevokePrivilegesStmt::execute(), and Parser::ShowPrivilegesStmt::execute().

3984  {
3985  std::string objectName;
3986  std::vector<std::string> componentNames = splitObjectHierName(objectHierName);
3987  if (objectType.compare("DATABASE") == 0) {
3988  if (componentNames.size() == 1) {
3989  objectName = componentNames[0];
3990  } else {
3991  throw std::runtime_error("DB object name is not correct " + objectHierName);
3992  }
3993  } else {
3994  if (objectType.compare("TABLE") == 0 || objectType.compare("DASHBOARD") == 0 ||
3995  objectType.compare("VIEW") == 0 || objectType.compare("SERVER") == 0) {
3996  switch (componentNames.size()) {
3997  case (1): {
3998  objectName = componentNames[0];
3999  break;
4000  }
4001  case (2): {
4002  objectName = componentNames[1];
4003  break;
4004  }
4005  default: {
4006  throw std::runtime_error("DB object name is not correct " + objectHierName);
4007  }
4008  }
4009  } else {
4010  throw std::runtime_error("DB object type " + objectType + " is not supported.");
4011  }
4012  }
4013  return objectName;
4014 }
std::vector< std::string > splitObjectHierName(const std::string &hierName)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getResultSet()

std::shared_ptr<ResultSet> Parser::getResultSet ( QueryStateProxy  query_state_proxy,
const std::string  select_stmt,
std::vector< TargetMetaInfo > &  targets,
bool  validate_only = false,
std::vector< size_t >  outer_fragment_indices = {} 
)

Definition at line 2349 of file ParserNode.cpp.

References CPU, CompilationOptions::defaults(), query_state::QueryState::getConstSessionInfo(), Executor::getExecutor(), query_state::QueryStateProxy::getQueryState(), LoopStrengthReduction, Native, pg_shim(), run_benchmark_import::result, and Executor::UNITARY_EXECUTOR_ID.

Referenced by Parser::LocalConnector::query().

2353  {}) {
2354  auto const session = query_state_proxy.getQueryState().getConstSessionInfo();
2355  auto& catalog = session->getCatalog();
2356 
2358 #ifdef HAVE_CUDA
2359  const auto device_type = session->get_executor_device_type();
2360 #else
2361  const auto device_type = ExecutorDeviceType::CPU;
2362 #endif // HAVE_CUDA
2363  auto calcite_mgr = catalog.getCalciteMgr();
2364 
2365  // TODO MAT this should actually get the global or the session parameter for
2366  // view optimization
2367  const auto query_ra =
2368  calcite_mgr
2369  ->process(query_state_proxy, pg_shim(select_stmt), {}, true, false, false, true)
2370  .plan_result;
2371  RelAlgExecutor ra_executor(executor.get(), catalog, query_ra);
2373  const auto& query_hints = ra_executor.getParsedQueryHints();
2374  if (query_hints.cpu_mode) {
2375  co.device_type = ExecutorDeviceType::CPU;
2376  }
2378  // TODO(adb): Need a better method of dropping constants into this ExecutionOptions
2379  // struct
2380  ExecutionOptions eo = {false,
2381  true,
2382  false,
2383  true,
2384  false,
2385  false,
2386  validate_only,
2387  false,
2388  10000,
2389  false,
2390  false,
2391  0.9,
2392  false,
2393  1000,
2395  outer_fragment_indices};
2396  ExecutionResult result{std::make_shared<ResultSet>(std::vector<TargetInfo>{},
2399  nullptr,
2400  nullptr),
2401  {}};
2402  result = ra_executor.executeRelAlgQuery(co, eo, false, nullptr);
2403  targets = result.getTargetsMeta();
2404 
2405  return result.getRows();
2406 }
static std::shared_ptr< Executor > getExecutor(const ExecutorId id, const std::string &debug_dir="", const std::string &debug_file="", const SystemParameters system_parameters=SystemParameters())
Definition: Execute.cpp:148
QueryState & getQueryState()
Definition: QueryState.h:172
std::shared_ptr< Catalog_Namespace::SessionInfo const > getConstSessionInfo() const
Definition: QueryState.cpp:77
static CompilationOptions defaults(const ExecutorDeviceType device_type=ExecutorDeviceType::GPU)
std::string pg_shim(const std::string &query)
static const ExecutorId UNITARY_EXECUTOR_ID
Definition: Execute.h:303
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseDDL()

template<typename DDLSTMT >
auto Parser::parseDDL ( const std::string &  stmt_type,
const std::string &  stmt_str 
)

Definition at line 29 of file ParseDDL.h.

References run_benchmark_import::parser.

29  {
30  std::list<std::unique_ptr<Parser::Stmt>> parse_trees;
31  std::string last_parsed;
32  SQLParser parser;
33  if (parser.parse(stmt_str, parse_trees, last_parsed) > 0) {
34  throw std::runtime_error("Syntax error in " + stmt_type + " \"" + stmt_str +
35  "\" at " + last_parsed);
36  }
37  if (auto ddl_stmt = dynamic_cast<DDLSTMT*>(parse_trees.front().get())) {
38  parse_trees.front().release();
39  return std::unique_ptr<DDLSTMT>(ddl_stmt);
40  }
41  throw std::runtime_error("Expected " + stmt_type + " is not found in \"" + stmt_str +
42  "\"");
43 }

◆ parser_slistval_to_vector()

void Parser::parser_slistval_to_vector ( std::list< std::string *> *  l,
std::vector< std::string > &  v 
)
inline

Definition at line 1508 of file ParserNode.h.

References CHECK.

Referenced by Parser::GrantPrivilegesStmt::GrantPrivilegesStmt(), Parser::GrantRoleStmt::GrantRoleStmt(), Parser::RevokePrivilegesStmt::RevokePrivilegesStmt(), and Parser::RevokeRoleStmt::RevokeRoleStmt().

1509  {
1510  CHECK(l);
1511  for (auto str : *l) {
1512  v.push_back(*str);
1513  delete str;
1514  }
1515  delete l;
1516 }
#define CHECK(condition)
Definition: Logger.h:197
+ Here is the caller graph for this function:

◆ parseStringPrivs()

static std::pair<AccessPrivileges, DBObjectType> Parser::parseStringPrivs ( const std::string &  privs,
const DBObjectType objectType,
const std::string &  object_name 
)
static

Definition at line 4016 of file ParserNode.cpp.

References AccessPrivileges::ACCESS, AccessPrivileges::ALL_DASHBOARD, AccessPrivileges::ALL_DATABASE, AccessPrivileges::ALL_SERVER, AccessPrivileges::ALL_TABLE, AccessPrivileges::ALL_VIEW, AccessPrivileges::ALTER_TABLE, AccessPrivileges::CREATE_DASHBOARD, AccessPrivileges::CREATE_SERVER, AccessPrivileges::CREATE_TABLE, AccessPrivileges::CREATE_VIEW, DashboardDBObjectType, DatabaseDBObjectType, AccessPrivileges::DELETE_DASHBOARD, AccessPrivileges::DELETE_FROM_TABLE, AccessPrivileges::DROP_SERVER, AccessPrivileges::DROP_TABLE, AccessPrivileges::DROP_VIEW, AccessPrivileges::EDIT_DASHBOARD, AccessPrivileges::INSERT_INTO_TABLE, run_benchmark_import::result, AccessPrivileges::SELECT_FROM_TABLE, AccessPrivileges::SELECT_FROM_VIEW, ServerDBObjectType, TableDBObjectType, AccessPrivileges::TRUNCATE_TABLE, AccessPrivileges::UPDATE_IN_TABLE, AccessPrivileges::VIEW_DASHBOARD, AccessPrivileges::VIEW_SQL_EDITOR, and ViewDBObjectType.

Referenced by Parser::GrantPrivilegesStmt::execute(), and Parser::RevokePrivilegesStmt::execute().

4019  {
4020  static const std::map<std::pair<const std::string, const DBObjectType>,
4021  std::pair<const AccessPrivileges, const DBObjectType>>
4022  privileges_lookup{
4023  {{"ALL"s, DatabaseDBObjectType},
4024  {AccessPrivileges::ALL_DATABASE, DatabaseDBObjectType}},
4025  {{"ALL"s, TableDBObjectType}, {AccessPrivileges::ALL_TABLE, TableDBObjectType}},
4026  {{"ALL"s, DashboardDBObjectType},
4027  {AccessPrivileges::ALL_DASHBOARD, DashboardDBObjectType}},
4028  {{"ALL"s, ViewDBObjectType}, {AccessPrivileges::ALL_VIEW, ViewDBObjectType}},
4029  {{"ALL"s, ServerDBObjectType},
4030  {AccessPrivileges::ALL_SERVER, ServerDBObjectType}},
4031 
4032  {{"CREATE TABLE"s, DatabaseDBObjectType},
4033  {AccessPrivileges::CREATE_TABLE, TableDBObjectType}},
4034  {{"CREATE"s, DatabaseDBObjectType},
4035  {AccessPrivileges::CREATE_TABLE, TableDBObjectType}},
4036  {{"SELECT"s, DatabaseDBObjectType},
4037  {AccessPrivileges::SELECT_FROM_TABLE, TableDBObjectType}},
4038  {{"INSERT"s, DatabaseDBObjectType},
4039  {AccessPrivileges::INSERT_INTO_TABLE, TableDBObjectType}},
4040  {{"TRUNCATE"s, DatabaseDBObjectType},
4041  {AccessPrivileges::TRUNCATE_TABLE, TableDBObjectType}},
4042  {{"UPDATE"s, DatabaseDBObjectType},
4043  {AccessPrivileges::UPDATE_IN_TABLE, TableDBObjectType}},
4044  {{"DELETE"s, DatabaseDBObjectType},
4045  {AccessPrivileges::DELETE_FROM_TABLE, TableDBObjectType}},
4046  {{"DROP"s, DatabaseDBObjectType},
4047  {AccessPrivileges::DROP_TABLE, TableDBObjectType}},
4048  {{"ALTER"s, DatabaseDBObjectType},
4049  {AccessPrivileges::ALTER_TABLE, TableDBObjectType}},
4050 
4051  {{"SELECT"s, TableDBObjectType},
4052  {AccessPrivileges::SELECT_FROM_TABLE, TableDBObjectType}},
4053  {{"INSERT"s, TableDBObjectType},
4054  {AccessPrivileges::INSERT_INTO_TABLE, TableDBObjectType}},
4055  {{"TRUNCATE"s, TableDBObjectType},
4056  {AccessPrivileges::TRUNCATE_TABLE, TableDBObjectType}},
4057  {{"UPDATE"s, TableDBObjectType},
4058  {AccessPrivileges::UPDATE_IN_TABLE, TableDBObjectType}},
4059  {{"DELETE"s, TableDBObjectType},
4060  {AccessPrivileges::DELETE_FROM_TABLE, TableDBObjectType}},
4061  {{"DROP"s, TableDBObjectType},
4062  {AccessPrivileges::DROP_TABLE, TableDBObjectType}},
4063  {{"ALTER"s, TableDBObjectType},
4064  {AccessPrivileges::ALTER_TABLE, TableDBObjectType}},
4065 
4066  {{"CREATE VIEW"s, DatabaseDBObjectType},
4067  {AccessPrivileges::CREATE_VIEW, ViewDBObjectType}},
4068  {{"SELECT VIEW"s, DatabaseDBObjectType},
4069  {AccessPrivileges::SELECT_FROM_VIEW, ViewDBObjectType}},
4070  {{"DROP VIEW"s, DatabaseDBObjectType},
4071  {AccessPrivileges::DROP_VIEW, ViewDBObjectType}},
4072  {{"SELECT"s, ViewDBObjectType},
4073  {AccessPrivileges::SELECT_FROM_VIEW, ViewDBObjectType}},
4074  {{"DROP"s, ViewDBObjectType}, {AccessPrivileges::DROP_VIEW, ViewDBObjectType}},
4075 
4076  {{"CREATE DASHBOARD"s, DatabaseDBObjectType},
4077  {AccessPrivileges::CREATE_DASHBOARD, DashboardDBObjectType}},
4078  {{"EDIT DASHBOARD"s, DatabaseDBObjectType},
4079  {AccessPrivileges::EDIT_DASHBOARD, DashboardDBObjectType}},
4080  {{"VIEW DASHBOARD"s, DatabaseDBObjectType},
4081  {AccessPrivileges::VIEW_DASHBOARD, DashboardDBObjectType}},
4082  {{"DELETE DASHBOARD"s, DatabaseDBObjectType},
4083  {AccessPrivileges::DELETE_DASHBOARD, DashboardDBObjectType}},
4084  {{"VIEW"s, DashboardDBObjectType},
4085  {AccessPrivileges::VIEW_DASHBOARD, DashboardDBObjectType}},
4086  {{"EDIT"s, DashboardDBObjectType},
4087  {AccessPrivileges::EDIT_DASHBOARD, DashboardDBObjectType}},
4088  {{"DELETE"s, DashboardDBObjectType},
4089  {AccessPrivileges::DELETE_DASHBOARD, DashboardDBObjectType}},
4090 
4091  {{"CREATE SERVER"s, DatabaseDBObjectType},
4092  {AccessPrivileges::CREATE_SERVER, ServerDBObjectType}},
4093  {{"DROP SERVER"s, DatabaseDBObjectType},
4094  {AccessPrivileges::DROP_SERVER, ServerDBObjectType}},
4095  {{"DROP"s, ServerDBObjectType},
4096  {AccessPrivileges::DROP_SERVER, ServerDBObjectType}},
4097 
4098  {{"VIEW SQL EDITOR"s, DatabaseDBObjectType},
4099  {AccessPrivileges::VIEW_SQL_EDITOR, DatabaseDBObjectType}},
4100  {{"ACCESS"s, DatabaseDBObjectType},
4101  {AccessPrivileges::ACCESS, DatabaseDBObjectType}}};
4102 
4103  auto result = privileges_lookup.find(std::make_pair(privs, objectType));
4104  if (result == privileges_lookup.end()) {
4105  throw std::runtime_error("Privileges " + privs + " on DB object " + object_name +
4106  " are not correct.");
4107  }
4108  return result->second;
4109 }
static const AccessPrivileges VIEW_SQL_EDITOR
Definition: DBObject.h:153
static const AccessPrivileges VIEW_DASHBOARD
Definition: DBObject.h:172
static const AccessPrivileges DROP_SERVER
Definition: DBObject.h:190
static const AccessPrivileges ALL_DATABASE
Definition: DBObject.h:152
static const AccessPrivileges ALTER_TABLE
Definition: DBObject.h:166
static const AccessPrivileges TRUNCATE_TABLE
Definition: DBObject.h:165
static const AccessPrivileges INSERT_INTO_TABLE
Definition: DBObject.h:162
static const AccessPrivileges CREATE_DASHBOARD
Definition: DBObject.h:171
static const AccessPrivileges SELECT_FROM_TABLE
Definition: DBObject.h:161
static const AccessPrivileges ALL_VIEW
Definition: DBObject.h:178
static const AccessPrivileges DROP_TABLE
Definition: DBObject.h:160
static const AccessPrivileges ALL_SERVER
Definition: DBObject.h:188
static const AccessPrivileges CREATE_SERVER
Definition: DBObject.h:189
static const AccessPrivileges DELETE_FROM_TABLE
Definition: DBObject.h:164
static const AccessPrivileges CREATE_TABLE
Definition: DBObject.h:159
static const AccessPrivileges SELECT_FROM_VIEW
Definition: DBObject.h:181
static const AccessPrivileges ALL_DASHBOARD
Definition: DBObject.h:170
static const AccessPrivileges ACCESS
Definition: DBObject.h:154
static const AccessPrivileges ALL_TABLE
Definition: DBObject.h:158
static const AccessPrivileges DROP_VIEW
Definition: DBObject.h:180
static const AccessPrivileges CREATE_VIEW
Definition: DBObject.h:179
static const AccessPrivileges DELETE_DASHBOARD
Definition: DBObject.h:174
static const AccessPrivileges EDIT_DASHBOARD
Definition: DBObject.h:173
static const AccessPrivileges UPDATE_IN_TABLE
Definition: DBObject.h:163
+ Here is the caller graph for this function:

◆ readBooleanLiteral()

static bool Parser::readBooleanLiteral ( const std::string &  option_name,
const std::unique_ptr< NameValueAssign > &  p 
)
static

Definition at line 4748 of file ParserNode.cpp.

References CHECK.

Referenced by Parser::CreateUserStmt::execute(), and Parser::AlterUserStmt::execute().

4749  {
4750  CHECK(p);
4751  const std::string* str =
4752  static_cast<const StringLiteral*>(p->get_value())->get_stringval();
4753  if (boost::iequals(*str, "true")) {
4754  return true;
4755  } else if (boost::iequals(*str, "false")) {
4756  return false;
4757  } else {
4758  throw std::runtime_error("Value to " + option_name + " must be TRUE or FALSE.");
4759  }
4760 }
#define CHECK(condition)
Definition: Logger.h:197
+ Here is the caller graph for this function:

◆ splitObjectHierName()

std::vector<std::string> Parser::splitObjectHierName ( const std::string &  hierName)

Definition at line 3976 of file ParserNode.cpp.

References split().

Referenced by extractObjectNameFromHierName().

3976  {
3977  std::vector<std::string> componentNames;
3978  boost::split(componentNames, hierName, boost::is_any_of("."));
3979  return componentNames;
3980 }
std::vector< std::string > split(std::string_view str, std::string_view delim, std::optional< size_t > maxsplit)
split apart a string into a vector of substrings
+ Here is the call graph for this function:
+ Here is the caller graph for this function: