OmniSciDB  c1a53651b2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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)
 
 ValidateStmt (const rapidjson::Value &payload)
 
bool isRepairTypeRemove () const
 
const std::string getType () const
 
void execute (const Catalog_Namespace::SessionInfo &session, bool read_only_mode) 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 1286 of file ParserNode.h.

Constructor & Destructor Documentation

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

Definition at line 4728 of file ParserNode.cpp.

References isRepairTypeRemove_, and Parser::repair_type().

4729  : type_(type) {
4730  if (!type) {
4731  throw std::runtime_error("Validation Type is required for VALIDATE command.");
4732  }
4733  std::list<std::unique_ptr<NameValueAssign>> options;
4734  if (with_opts) {
4735  for (const auto e : *with_opts) {
4736  options.emplace_back(e);
4737  }
4738  delete with_opts;
4739 
4740  isRepairTypeRemove_ = repair_type(options);
4741  }
4742 }
bool repair_type(std::list< std::unique_ptr< NameValueAssign >> &options)
std::unique_ptr< std::string > type_
Definition: ParserNode.h:1301

+ Here is the call graph for this function:

Parser::ValidateStmt::ValidateStmt ( const rapidjson::Value &  payload)

Definition at line 4744 of file ParserNode.cpp.

References CHECK, isRepairTypeRemove_, json_str(), Parser::anonymous_namespace{ParserNode.cpp}::parse_options(), Parser::repair_type(), and type_.

4744  {
4745  CHECK(payload.HasMember("type"));
4746  type_ = std::make_unique<std::string>(json_str(payload["type"]));
4747 
4748  std::list<std::unique_ptr<NameValueAssign>> options;
4749  parse_options(payload, options);
4750 
4751  isRepairTypeRemove_ = repair_type(options);
4752 }
bool repair_type(std::list< std::unique_ptr< NameValueAssign >> &options)
const std::string json_str(const rapidjson::Value &obj) noexcept
Definition: JsonAccessors.h:44
std::unique_ptr< std::string > type_
Definition: ParserNode.h:1301
void parse_options(const rapidjson::Value &payload, std::list< std::unique_ptr< NameValueAssign >> &nameValueList, bool stringToNull=false, bool stringToInteger=false)
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the call graph for this function:

Member Function Documentation

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

Implements Parser::DDLStmt.

Definition at line 1295 of file ParserNode.h.

References UNREACHABLE.

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

1296  {
1297  UNREACHABLE();
1298  }
#define UNREACHABLE()
Definition: Logger.h:337

+ Here is the caller graph for this function:

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

Definition at line 1293 of file ParserNode.h.

References type_.

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

Definition at line 1291 of file ParserNode.h.

References isRepairTypeRemove_.

1291 { return isRepairTypeRemove_; }

Member Data Documentation

bool Parser::ValidateStmt::isRepairTypeRemove_ = false
private

Definition at line 1302 of file ParserNode.h.

Referenced by isRepairTypeRemove(), and ValidateStmt().

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

Definition at line 1301 of file ParserNode.h.

Referenced by getType(), and ValidateStmt().


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