OmniSciDB  ba1bac9284
 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 1237 of file ParserNode.h.

Constructor & Destructor Documentation

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

Definition at line 1239 of file ParserNode.h.

References CHECK, isRepairTypeRemove_, and type_.

1239  : type_(type) {
1240  if (!type_) {
1241  throw std::runtime_error("Validation Type is required for VALIDATE command.");
1242  }
1243  std::list<std::unique_ptr<NameValueAssign>> options;
1244  if (with_opts) {
1245  for (const auto e : *with_opts) {
1246  options.emplace_back(e);
1247  }
1248  delete with_opts;
1249 
1250  for (const auto& opt : options) {
1251  if (boost::iequals(*opt->get_name(), "REPAIR_TYPE")) {
1252  const auto repair_type =
1253  static_cast<const StringLiteral*>(opt->get_value())->get_stringval();
1254  CHECK(repair_type);
1255  if (boost::iequals(*repair_type, "REMOVE")) {
1256  isRepairTypeRemove_ = true;
1257  } else {
1258  throw std::runtime_error("REPAIR_TYPE must be REMOVE.");
1259  }
1260  } else {
1261  throw std::runtime_error("The only VALIDATE WITH options is REPAIR_TYPE.");
1262  }
1263  }
1264  }
1265  }
std::unique_ptr< std::string > type_
Definition: ParserNode.h:1274
#define CHECK(condition)
Definition: Logger.h:206

Member Function Documentation

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

Implements Parser::DDLStmt.

Definition at line 1271 of file ParserNode.h.

References UNREACHABLE.

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

1271 { UNREACHABLE(); }
#define UNREACHABLE()
Definition: Logger.h:250

+ Here is the caller graph for this function:

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

Definition at line 1269 of file ParserNode.h.

References type_.

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

Definition at line 1267 of file ParserNode.h.

References isRepairTypeRemove_.

1267 { return isRepairTypeRemove_; }

Member Data Documentation

bool Parser::ValidateStmt::isRepairTypeRemove_ = false
private

Definition at line 1275 of file ParserNode.h.

Referenced by isRepairTypeRemove(), and ValidateStmt().

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

Definition at line 1274 of file ParserNode.h.

Referenced by getType(), and ValidateStmt().


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