OmniSciDB  c0231cc57d
 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 4701 of file ParserNode.cpp.

References isRepairTypeRemove_, and Parser::repair_type().

4702  : type_(type) {
4703  if (!type) {
4704  throw std::runtime_error("Validation Type is required for VALIDATE command.");
4705  }
4706  std::list<std::unique_ptr<NameValueAssign>> options;
4707  if (with_opts) {
4708  for (const auto e : *with_opts) {
4709  options.emplace_back(e);
4710  }
4711  delete with_opts;
4712 
4713  isRepairTypeRemove_ = repair_type(options);
4714  }
4715 }
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 4717 of file ParserNode.cpp.

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

4717  {
4718  CHECK(payload.HasMember("type"));
4719  type_ = std::make_unique<std::string>(json_str(payload["type"]));
4720 
4721  std::list<std::unique_ptr<NameValueAssign>> options;
4722  parse_options(payload, options);
4723 
4724  isRepairTypeRemove_ = repair_type(options);
4725 }
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:222

+ 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:266

+ 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: