OmniSciDB  72c90bc290
 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 5050 of file ParserNode.cpp.

References isRepairTypeRemove_, and Parser::repair_type().

5051  : type_(type) {
5052  if (!type) {
5053  throw std::runtime_error("Validation Type is required for VALIDATE command.");
5054  }
5055  std::list<std::unique_ptr<NameValueAssign>> options;
5056  if (with_opts) {
5057  for (const auto e : *with_opts) {
5058  options.emplace_back(e);
5059  }
5060  delete with_opts;
5061 
5062  isRepairTypeRemove_ = repair_type(options);
5063  }
5064 }
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 5066 of file ParserNode.cpp.

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

5066  {
5067  CHECK(payload.HasMember("type"));
5068  type_ = std::make_unique<std::string>(json_str(payload["type"]));
5069 
5070  std::list<std::unique_ptr<NameValueAssign>> options;
5071  parse_options(payload, options);
5072 
5073  isRepairTypeRemove_ = repair_type(options);
5074 }
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: