OmniSciDB  06b3bd477c
 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 1199 of file ParserNode.h.

Constructor & Destructor Documentation

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

Definition at line 1201 of file ParserNode.h.

References CHECK(), isRepairTypeRemove_, and type_.

1201  : type_(type) {
1202  if (!type_) {
1203  throw std::runtime_error("Validation Type is required for VALIDATE command.");
1204  }
1205  std::list<std::unique_ptr<NameValueAssign>> options;
1206  if (with_opts) {
1207  for (const auto e : *with_opts) {
1208  options.emplace_back(e);
1209  }
1210  delete with_opts;
1211 
1212  for (const auto& opt : options) {
1213  if (boost::iequals(*opt->get_name(), "REPAIR_TYPE")) {
1214  const auto repair_type =
1215  static_cast<const StringLiteral*>(opt->get_value())->get_stringval();
1216  CHECK(repair_type);
1217  if (boost::iequals(*repair_type, "REMOVE")) {
1218  isRepairTypeRemove_ = true;
1219  } else {
1220  throw std::runtime_error("REPAIR_TYPE must be REMOVE.");
1221  }
1222  } else {
1223  throw std::runtime_error("The only VALIDATE WITH options is REPAIR_TYPE.");
1224  }
1225  }
1226  }
1227  }
CHECK(cgen_state)
std::unique_ptr< std::string > type_
Definition: ParserNode.h:1236

+ 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 1233 of file ParserNode.h.

References UNREACHABLE.

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

Definition at line 1231 of file ParserNode.h.

References type_.

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

Definition at line 1229 of file ParserNode.h.

References isRepairTypeRemove_.

1229 { return isRepairTypeRemove_; }

Member Data Documentation

bool Parser::ValidateStmt::isRepairTypeRemove_ = false
private

Definition at line 1237 of file ParserNode.h.

Referenced by isRepairTypeRemove(), and ValidateStmt().

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

Definition at line 1236 of file ParserNode.h.

Referenced by getType(), and ValidateStmt().


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