OmniSciDB  a5dc49c757
 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 1273 of file ParserNode.h.

Constructor & Destructor Documentation

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

Definition at line 5071 of file ParserNode.cpp.

References isRepairTypeRemove_, and Parser::repair_type().

5072  : type_(type) {
5073  if (!type) {
5074  throw std::runtime_error("Validation Type is required for VALIDATE command.");
5075  }
5076  std::list<std::unique_ptr<NameValueAssign>> options;
5077  if (with_opts) {
5078  for (const auto e : *with_opts) {
5079  options.emplace_back(e);
5080  }
5081  delete with_opts;
5082 
5083  isRepairTypeRemove_ = repair_type(options);
5084  }
5085 }
bool repair_type(std::list< std::unique_ptr< NameValueAssign >> &options)
std::unique_ptr< std::string > type_
Definition: ParserNode.h:1288

+ Here is the call graph for this function:

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

Definition at line 5087 of file ParserNode.cpp.

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

5087  {
5088  CHECK(payload.HasMember("type"));
5089  type_ = std::make_unique<std::string>(json_str(payload["type"]));
5090 
5091  std::list<std::unique_ptr<NameValueAssign>> options;
5092  parse_options(payload, options);
5093 
5094  isRepairTypeRemove_ = repair_type(options);
5095 }
bool repair_type(std::list< std::unique_ptr< NameValueAssign >> &options)
const std::string json_str(const rapidjson::Value &obj) noexcept
Definition: JsonAccessors.h:46
std::unique_ptr< std::string > type_
Definition: ParserNode.h:1288
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 1282 of file ParserNode.h.

References UNREACHABLE.

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

1283  {
1284  UNREACHABLE();
1285  }
#define UNREACHABLE()
Definition: Logger.h:338

+ Here is the caller graph for this function:

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

Definition at line 1280 of file ParserNode.h.

References type_.

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

Definition at line 1278 of file ParserNode.h.

References isRepairTypeRemove_.

1278 { return isRepairTypeRemove_; }

Member Data Documentation

bool Parser::ValidateStmt::isRepairTypeRemove_ = false
private

Definition at line 1289 of file ParserNode.h.

Referenced by isRepairTypeRemove(), and ValidateStmt().

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

Definition at line 1288 of file ParserNode.h.

Referenced by getType(), and ValidateStmt().


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