OmniSciDB  04ee39c94c
GeoPointColumnDescriptor Class Reference
+ Inheritance diagram for GeoPointColumnDescriptor:
+ Collaboration diagram for GeoPointColumnDescriptor:

Public Member Functions

 GeoPointColumnDescriptor (SQLTypes sql_type=kPOINT)
 
bool skip_test (std::string name) override
 
std::string get_column_definition () override
 
std::string getColumnWktStringValue (int row)
 
std::string get_column_value (int row) override
 
bool check_column_value (int row, const TDatum *value) override
 
 GeoPointColumnDescriptor (SQLTypes sql_type=kPOINT)
 
bool skip_test (std::string name) override
 
std::string get_column_definition () override
 
std::string getColumnWktStringValue (int row)
 
std::string get_column_value (int row) override
 
bool check_column_value (int row, const SQLTypeInfo &type, const ScalarTargetValue *value) override
 
- Public Member Functions inherited from TestColumnDescriptor
virtual std::string get_update_column_value (int row)
 
virtual ~TestColumnDescriptor ()=default
 
virtual std::string get_update_column_value (int row)
 
virtual bool check_column_value (const int row, const SQLTypeInfo &type, const TargetValue *value)
 
virtual ~TestColumnDescriptor ()=default
 

Private Attributes

std::string prefix
 
SQLTypes rs_type
 

Detailed Description

Definition at line 415 of file CtasIntegrationTest.cpp.

Constructor & Destructor Documentation

◆ GeoPointColumnDescriptor() [1/2]

GeoPointColumnDescriptor::GeoPointColumnDescriptor ( SQLTypes  sql_type = kPOINT)
inline

Definition at line 419 of file CtasIntegrationTest.cpp.

419 {};

◆ GeoPointColumnDescriptor() [2/2]

GeoPointColumnDescriptor::GeoPointColumnDescriptor ( SQLTypes  sql_type = kPOINT)
inline

Definition at line 407 of file CtasUpdateTest.cpp.

407 : rs_type(sql_type){};

Member Function Documentation

◆ check_column_value() [1/2]

bool GeoPointColumnDescriptor::check_column_value ( int  row,
const SQLTypeInfo type,
const ScalarTargetValue value 
)
inlineoverridevirtual

Implements TestColumnDescriptor.

Definition at line 420 of file CtasUpdateTest.cpp.

References logger::ERROR, SQLTypeInfoCore< TYPE_FACET_PACK >::get_type(), LOG, and to_string().

422  {
423  if (!(type.get_type() == rs_type)) {
424  return false;
425  }
426 
427  const auto mapd_as_str_p = boost::get<NullableString>(value);
428  if (nullptr == mapd_as_str_p) {
429  return false;
430  }
431 
432  const auto mapd_str_p = boost::get<std::string>(mapd_as_str_p);
433  if (nullptr == mapd_str_p) {
434  return false;
435  }
436 
437  const auto mapd_val = *mapd_str_p;
438  if (mapd_val == getColumnWktStringValue(row)) {
439  return true;
440  }
441 
442  LOG(ERROR) << "row: " << std::to_string(row) << " " << getColumnWktStringValue(row)
443  << " vs. " << mapd_val;
444  return false;
445  }
#define LOG(tag)
Definition: Logger.h:182
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:323
std::string to_string(char const *&&v)
std::string getColumnWktStringValue(int row)
+ Here is the call graph for this function:

◆ check_column_value() [2/2]

bool GeoPointColumnDescriptor::check_column_value ( int  row,
const TDatum *  value 
)
inlineoverridevirtual

Implements TestColumnDescriptor.

Definition at line 432 of file CtasIntegrationTest.cpp.

References checked_get(), logger::ERROR, LOG, and to_string().

432  {
433  std::string mapd_val;
434  if (!checked_get(row, value, mapd_val, std::string(""))) {
435  return false;
436  }
437 
438  if (mapd_val == getColumnWktStringValue(row)) {
439  return true;
440  }
441 
442  LOG(ERROR) << "row: " << std::to_string(row) << " " << getColumnWktStringValue(row)
443  << " vs. " << mapd_val;
444  return false;
445  }
#define LOG(tag)
Definition: Logger.h:182
std::string to_string(char const *&&v)
bool checked_get(size_t row, const SOURCE_TYPE *boost_variant, RETURN_TYPE &val, RETURN_TYPE null_value)
std::string getColumnWktStringValue(int row)
+ Here is the call graph for this function:

◆ get_column_definition() [1/2]

std::string GeoPointColumnDescriptor::get_column_definition ( )
inlineoverridevirtual

Implements TestColumnDescriptor.

Definition at line 411 of file CtasUpdateTest.cpp.

411 { return "POINT"; };

◆ get_column_definition() [2/2]

std::string GeoPointColumnDescriptor::get_column_definition ( )
inlineoverridevirtual

Implements TestColumnDescriptor.

Definition at line 423 of file CtasIntegrationTest.cpp.

423 { return "POINT"; };

◆ get_column_value() [1/2]

std::string GeoPointColumnDescriptor::get_column_value ( int  row)
inlineoverridevirtual

Implements TestColumnDescriptor.

Definition at line 416 of file CtasUpdateTest.cpp.

416  {
417  return "'" + getColumnWktStringValue(row) + "'";
418  };
std::string getColumnWktStringValue(int row)

◆ get_column_value() [2/2]

std::string GeoPointColumnDescriptor::get_column_value ( int  row)
inlineoverridevirtual

Implements TestColumnDescriptor.

Definition at line 428 of file CtasIntegrationTest.cpp.

428  {
429  return "'" + getColumnWktStringValue(row) + "'";
430  };
std::string getColumnWktStringValue(int row)

◆ getColumnWktStringValue() [1/2]

std::string GeoPointColumnDescriptor::getColumnWktStringValue ( int  row)
inline

Definition at line 413 of file CtasUpdateTest.cpp.

References to_string().

413  {
414  return "POINT (" + std::to_string(row) + " 0)";
415  }
std::string to_string(char const *&&v)
+ Here is the call graph for this function:

◆ getColumnWktStringValue() [2/2]

std::string GeoPointColumnDescriptor::getColumnWktStringValue ( int  row)
inline

Definition at line 425 of file CtasIntegrationTest.cpp.

References to_string().

425  {
426  return "POINT (" + std::to_string(row) + " 0)";
427  }
std::string to_string(char const *&&v)
+ Here is the call graph for this function:

◆ skip_test() [1/2]

bool GeoPointColumnDescriptor::skip_test ( std::string  name)
inlineoverridevirtual

Reimplemented from TestColumnDescriptor.

Definition at line 409 of file CtasUpdateTest.cpp.

409 { return "CreateTableAsSelect" != name; }

◆ skip_test() [2/2]

bool GeoPointColumnDescriptor::skip_test ( std::string  name)
inlineoverridevirtual

Reimplemented from TestColumnDescriptor.

Definition at line 421 of file CtasIntegrationTest.cpp.

421 { return "CreateTableAsSelect" != name; }

Member Data Documentation

◆ prefix

std::string GeoPointColumnDescriptor::prefix
private

Definition at line 416 of file CtasIntegrationTest.cpp.

◆ rs_type

SQLTypes GeoPointColumnDescriptor::rs_type
private

Definition at line 403 of file CtasUpdateTest.cpp.


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