OmniSciDB  0264ff685a
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 1208 of file ParserNode.h.

Constructor & Destructor Documentation

◆ ValidateStmt()

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

Definition at line 1210 of file ParserNode.h.

References CHECK.

1210  : type_(type) {
1211  if (!type_) {
1212  throw std::runtime_error("Validation Type is required for VALIDATE command.");
1213  }
1214  std::list<std::unique_ptr<NameValueAssign>> options;
1215  if (with_opts) {
1216  for (const auto e : *with_opts) {
1217  options.emplace_back(e);
1218  }
1219  delete with_opts;
1220 
1221  for (const auto& opt : options) {
1222  if (boost::iequals(*opt->get_name(), "REPAIR_TYPE")) {
1223  const auto repair_type =
1224  static_cast<const StringLiteral*>(opt->get_value())->get_stringval();
1225  CHECK(repair_type);
1226  if (boost::iequals(*repair_type, "REMOVE")) {
1227  isRepairTypeRemove_ = true;
1228  } else {
1229  throw std::runtime_error("REPAIR_TYPE must be REMOVE.");
1230  }
1231  } else {
1232  throw std::runtime_error("The only VALIDATE WITH options is REPAIR_TYPE.");
1233  }
1234  }
1235  }
1236  }
std::unique_ptr< std::string > type_
Definition: ParserNode.h:1245
#define CHECK(condition)
Definition: Logger.h:197

Member Function Documentation

◆ execute()

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

Implements Parser::DDLStmt.

Definition at line 1242 of file ParserNode.h.

References UNREACHABLE.

Referenced by omnisci.cursor.Cursor::executemany().

1242 { UNREACHABLE(); }
#define UNREACHABLE()
Definition: Logger.h:241
+ Here is the caller graph for this function:

◆ getType()

const std::string Parser::ValidateStmt::getType ( ) const
inline

Definition at line 1240 of file ParserNode.h.

1240 { return *(type_.get()); }
std::unique_ptr< std::string > type_
Definition: ParserNode.h:1245

◆ isRepairTypeRemove()

bool Parser::ValidateStmt::isRepairTypeRemove ( ) const
inline

Definition at line 1238 of file ParserNode.h.

1238 { return isRepairTypeRemove_; }

Member Data Documentation

◆ isRepairTypeRemove_

bool Parser::ValidateStmt::isRepairTypeRemove_ = false
private

Definition at line 1246 of file ParserNode.h.

◆ type_

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

Definition at line 1245 of file ParserNode.h.


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