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

Public Member Functions

 GeoLinestringColumnDescriptor (SQLTypes sql_type=kLINESTRING)
 
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
 
 GeoLinestringColumnDescriptor (SQLTypes sql_type=kLINESTRING)
 
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 448 of file CtasIntegrationTest.cpp.

Constructor & Destructor Documentation

◆ GeoLinestringColumnDescriptor() [1/2]

GeoLinestringColumnDescriptor::GeoLinestringColumnDescriptor ( SQLTypes  sql_type = kLINESTRING)
inline

Definition at line 452 of file CtasIntegrationTest.cpp.

452 {};

◆ GeoLinestringColumnDescriptor() [2/2]

GeoLinestringColumnDescriptor::GeoLinestringColumnDescriptor ( SQLTypes  sql_type = kLINESTRING)
inline

Definition at line 453 of file CtasUpdateTest.cpp.

453 : rs_type(sql_type){};

Member Function Documentation

◆ check_column_value() [1/2]

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

Implements TestColumnDescriptor.

Definition at line 470 of file CtasIntegrationTest.cpp.

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

470  {
471  std::string mapd_val;
472  if (!checked_get(row, value, mapd_val, std::string(""))) {
473  return false;
474  }
475 
476  if (mapd_val == getColumnWktStringValue(row)) {
477  return true;
478  }
479 
480  LOG(ERROR) << "row: " << std::to_string(row) << " " << getColumnWktStringValue(row)
481  << " vs. " << mapd_val;
482  return false;
483  }
std::string getColumnWktStringValue(int row)
#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)
+ Here is the call graph for this function:

◆ check_column_value() [2/2]

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

Implements TestColumnDescriptor.

Definition at line 471 of file CtasUpdateTest.cpp.

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

473  {
474  if (!(type.get_type() == rs_type)) {
475  return false;
476  }
477 
478  const auto mapd_as_str_p = boost::get<NullableString>(value);
479  if (nullptr == mapd_as_str_p) {
480  return false;
481  }
482 
483  const auto mapd_str_p = boost::get<std::string>(mapd_as_str_p);
484  if (nullptr == mapd_str_p) {
485  return false;
486  }
487 
488  const auto mapd_val = *mapd_str_p;
489  if (mapd_val == getColumnWktStringValue(row)) {
490  return true;
491  }
492 
493  LOG(ERROR) << "row: " << std::to_string(row) << " " << getColumnWktStringValue(row)
494  << " vs. " << mapd_val;
495  return false;
496  }
std::string getColumnWktStringValue(int row)
#define LOG(tag)
Definition: Logger.h:182
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:323
std::string to_string(char const *&&v)
+ Here is the call graph for this function:

◆ get_column_definition() [1/2]

std::string GeoLinestringColumnDescriptor::get_column_definition ( )
inlineoverridevirtual

Implements TestColumnDescriptor.

Definition at line 456 of file CtasIntegrationTest.cpp.

456 { return "LINESTRING"; };

◆ get_column_definition() [2/2]

std::string GeoLinestringColumnDescriptor::get_column_definition ( )
inlineoverridevirtual

Implements TestColumnDescriptor.

Definition at line 457 of file CtasUpdateTest.cpp.

457 { return "LINESTRING"; };

◆ get_column_value() [1/2]

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

Implements TestColumnDescriptor.

Definition at line 466 of file CtasIntegrationTest.cpp.

466  {
467  return "'" + getColumnWktStringValue(row) + "'";
468  };
std::string getColumnWktStringValue(int row)

◆ get_column_value() [2/2]

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

Implements TestColumnDescriptor.

Definition at line 467 of file CtasUpdateTest.cpp.

467  {
468  return "'" + getColumnWktStringValue(row) + "'";
469  };
std::string getColumnWktStringValue(int row)

◆ getColumnWktStringValue() [1/2]

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

Definition at line 458 of file CtasIntegrationTest.cpp.

References to_string().

458  {
459  std::string linestring = "LINESTRING (0 0";
460  for (int i = 0; i <= row; i++) {
461  linestring += "," + std::to_string(row) + " 0";
462  }
463  linestring += ")";
464  return linestring;
465  }
std::string to_string(char const *&&v)
+ Here is the call graph for this function:

◆ getColumnWktStringValue() [2/2]

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

Definition at line 459 of file CtasUpdateTest.cpp.

References to_string().

459  {
460  std::string linestring = "LINESTRING (0 0";
461  for (int i = 0; i <= row; i++) {
462  linestring += "," + std::to_string(row) + " 0";
463  }
464  linestring += ")";
465  return linestring;
466  }
std::string to_string(char const *&&v)
+ Here is the call graph for this function:

◆ skip_test() [1/2]

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

Reimplemented from TestColumnDescriptor.

Definition at line 454 of file CtasIntegrationTest.cpp.

454 { return "CreateTableAsSelect" != name; }

◆ skip_test() [2/2]

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

Reimplemented from TestColumnDescriptor.

Definition at line 455 of file CtasUpdateTest.cpp.

455 { return "CreateTableAsSelect" != name; }

Member Data Documentation

◆ prefix

std::string GeoLinestringColumnDescriptor::prefix
private

Definition at line 449 of file CtasIntegrationTest.cpp.

◆ rs_type

SQLTypes GeoLinestringColumnDescriptor::rs_type
private

Definition at line 449 of file CtasUpdateTest.cpp.


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