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

Public Member Functions

 GeoMultiPolygonColumnDescriptor (SQLTypes sql_type=kMULTIPOLYGON)
 
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
 
 GeoMultiPolygonColumnDescriptor (SQLTypes sql_type=kMULTIPOLYGON)
 
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 486 of file CtasIntegrationTest.cpp.

Constructor & Destructor Documentation

◆ GeoMultiPolygonColumnDescriptor() [1/2]

GeoMultiPolygonColumnDescriptor::GeoMultiPolygonColumnDescriptor ( SQLTypes  sql_type = kMULTIPOLYGON)
inline

Definition at line 490 of file CtasIntegrationTest.cpp.

490 {};

◆ GeoMultiPolygonColumnDescriptor() [2/2]

GeoMultiPolygonColumnDescriptor::GeoMultiPolygonColumnDescriptor ( SQLTypes  sql_type = kMULTIPOLYGON)
inline

Definition at line 504 of file CtasUpdateTest.cpp.

505  : rs_type(sql_type){};

Member Function Documentation

◆ check_column_value() [1/2]

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

Implements TestColumnDescriptor.

Definition at line 510 of file CtasIntegrationTest.cpp.

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

510  {
511  std::string mapd_val;
512  if (!checked_get(row, value, mapd_val, std::string(""))) {
513  return false;
514  }
515 
516  if (mapd_val == getColumnWktStringValue(row)) {
517  return true;
518  }
519 
520  LOG(ERROR) << "row: " << std::to_string(row) << " " << getColumnWktStringValue(row)
521  << " vs. " << mapd_val;
522  return false;
523  }
#define LOG(tag)
Definition: Logger.h:182
std::string to_string(char const *&&v)
std::string getColumnWktStringValue(int row)
bool checked_get(size_t row, const SOURCE_TYPE *boost_variant, RETURN_TYPE &val, RETURN_TYPE null_value)
+ Here is the call graph for this function:

◆ check_column_value() [2/2]

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

Implements TestColumnDescriptor.

Definition at line 525 of file CtasUpdateTest.cpp.

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

527  {
528  if (!(type.get_type() == rs_type)) {
529  return false;
530  }
531 
532  const auto mapd_as_str_p = boost::get<NullableString>(value);
533  if (nullptr == mapd_as_str_p) {
534  return false;
535  }
536 
537  const auto mapd_str_p = boost::get<std::string>(mapd_as_str_p);
538  if (nullptr == mapd_str_p) {
539  return false;
540  }
541 
542  const auto mapd_val = *mapd_str_p;
543  if (mapd_val == getColumnWktStringValue(row)) {
544  return true;
545  }
546 
547  LOG(ERROR) << "row: " << std::to_string(row) << " " << getColumnWktStringValue(row)
548  << " vs. " << mapd_val;
549  return false;
550  }
#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:

◆ get_column_definition() [1/2]

std::string GeoMultiPolygonColumnDescriptor::get_column_definition ( )
inlineoverridevirtual

Implements TestColumnDescriptor.

Definition at line 494 of file CtasIntegrationTest.cpp.

494 { return "MULTIPOLYGON"; };

◆ get_column_definition() [2/2]

std::string GeoMultiPolygonColumnDescriptor::get_column_definition ( )
inlineoverridevirtual

Implements TestColumnDescriptor.

Definition at line 509 of file CtasUpdateTest.cpp.

509 { return "MULTIPOLYGON"; };

◆ get_column_value() [1/2]

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

Implements TestColumnDescriptor.

Definition at line 506 of file CtasIntegrationTest.cpp.

506  {
507  return "'" + getColumnWktStringValue(row) + "'";
508  };
std::string getColumnWktStringValue(int row)

◆ get_column_value() [2/2]

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

Implements TestColumnDescriptor.

Definition at line 521 of file CtasUpdateTest.cpp.

521  {
522  return "'" + getColumnWktStringValue(row) + "'";
523  };
std::string getColumnWktStringValue(int row)

◆ getColumnWktStringValue() [1/2]

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

Definition at line 496 of file CtasIntegrationTest.cpp.

References to_string().

496  {
497  std::string polygon =
498  "MULTIPOLYGON (((0 " + std::to_string(row) + ",4 " + std::to_string(row) + ",4 " +
499  std::to_string(row + 4) + ",0 " + std::to_string(row + 4) + ",0 " +
500  std::to_string(row) + "),(1 " + std::to_string(row + 1) + ",1 " +
501  std::to_string(row + 2) + ",2 " + std::to_string(row + 2) + ",2 " +
502  std::to_string(row + 1) + ",1 " + std::to_string(row + 1) + ")))";
503  return polygon;
504  }
std::string to_string(char const *&&v)
+ Here is the call graph for this function:

◆ getColumnWktStringValue() [2/2]

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

Definition at line 511 of file CtasUpdateTest.cpp.

References to_string().

511  {
512  std::string polygon =
513  "MULTIPOLYGON (((0 " + std::to_string(row) + ",4 " + std::to_string(row) + ",4 " +
514  std::to_string(row + 4) + ",0 " + std::to_string(row + 4) + ",0 " +
515  std::to_string(row) + "),(1 " + std::to_string(row + 1) + ",1 " +
516  std::to_string(row + 2) + ",2 " + std::to_string(row + 2) + ",2 " +
517  std::to_string(row + 1) + ",1 " + std::to_string(row + 1) + ")))";
518  return polygon;
519  }
std::string to_string(char const *&&v)
+ Here is the call graph for this function:

◆ skip_test() [1/2]

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

Reimplemented from TestColumnDescriptor.

Definition at line 492 of file CtasIntegrationTest.cpp.

492 { return "CreateTableAsSelect" != name; }

◆ skip_test() [2/2]

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

Reimplemented from TestColumnDescriptor.

Definition at line 507 of file CtasUpdateTest.cpp.

507 { return "CreateTableAsSelect" != name; }

Member Data Documentation

◆ prefix

std::string GeoMultiPolygonColumnDescriptor::prefix
private

Definition at line 487 of file CtasIntegrationTest.cpp.

◆ rs_type

SQLTypes GeoMultiPolygonColumnDescriptor::rs_type
private

Definition at line 500 of file CtasUpdateTest.cpp.


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