OmniSciDB  b24e664e58
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Parser::ValidateStmt Class Reference

#include <ParserNode.h>

+ Inheritance diagram for Parser::ValidateStmt:
+ Collaboration diagram for Parser::ValidateStmt:

Public Member Functions

 ValidateStmt (std::string *type, std::list< NameValueAssign * > *with_opts)
 
bool isRepairTypeRemove () const
 
const std::string getType () const
 
void execute (const Catalog_Namespace::SessionInfo &session) override
 
- Public Member Functions inherited from Parser::DDLStmt
void setColumnDescriptor (ColumnDescriptor &cd, const ColumnDef *coldef)
 
- Public Member Functions inherited from Parser::Node
virtual ~Node ()
 

Private Attributes

std::unique_ptr< std::string > type_
 
bool isRepairTypeRemove_ = false
 

Detailed Description

Definition at line 1159 of file ParserNode.h.

Constructor & Destructor Documentation

Parser::ValidateStmt::ValidateStmt ( std::string *  type,
std::list< NameValueAssign * > *  with_opts 
)
inline

Definition at line 1161 of file ParserNode.h.

References CHECK(), isRepairTypeRemove_, and type_.

1161  : type_(type) {
1162  if (!type_) {
1163  throw std::runtime_error("Validation Type is required for VALIDATE command.");
1164  }
1165  std::list<std::unique_ptr<NameValueAssign>> options;
1166  if (with_opts) {
1167  for (const auto e : *with_opts) {
1168  options.emplace_back(e);
1169  }
1170  delete with_opts;
1171 
1172  for (const auto& opt : options) {
1173  if (boost::iequals(*opt->get_name(), "REPAIR_TYPE")) {
1174  const auto repair_type =
1175  static_cast<const StringLiteral*>(opt->get_value())->get_stringval();
1176  CHECK(repair_type);
1177  if (boost::iequals(*repair_type, "REMOVE")) {
1178  isRepairTypeRemove_ = true;
1179  } else {
1180  throw std::runtime_error("REPAIR_TYPE must be REMOVE.");
1181  }
1182  } else {
1183  throw std::runtime_error("The only VALIDATE WITH options is REPAIR_TYPE.");
1184  }
1185  }
1186  }
1187  }
CHECK(cgen_state)
std::unique_ptr< std::string > type_
Definition: ParserNode.h:1196

+ Here is the call graph for this function:

Member Function Documentation

void Parser::ValidateStmt::execute ( const Catalog_Namespace::SessionInfo session)
inlineoverridevirtual

Implements Parser::DDLStmt.

Definition at line 1193 of file ParserNode.h.

References UNREACHABLE.

1193 { UNREACHABLE(); }
#define UNREACHABLE()
Definition: Logger.h:234
const std::string Parser::ValidateStmt::getType ( ) const
inline

Definition at line 1191 of file ParserNode.h.

References type_.

1191 { return *(type_.get()); }
std::unique_ptr< std::string > type_
Definition: ParserNode.h:1196
bool Parser::ValidateStmt::isRepairTypeRemove ( ) const
inline

Definition at line 1189 of file ParserNode.h.

References isRepairTypeRemove_.

1189 { return isRepairTypeRemove_; }

Member Data Documentation

bool Parser::ValidateStmt::isRepairTypeRemove_ = false
private

Definition at line 1197 of file ParserNode.h.

Referenced by isRepairTypeRemove(), and ValidateStmt().

std::unique_ptr<std::string> Parser::ValidateStmt::type_
private

Definition at line 1196 of file ParserNode.h.

Referenced by getType(), and ValidateStmt().


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