OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GeoMultiPolygonValueConverter Struct Reference

#include <TargetValueConvertersImpl.h>

+ Inheritance diagram for GeoMultiPolygonValueConverter:
+ Collaboration diagram for GeoMultiPolygonValueConverter:

Public Member Functions

 GeoMultiPolygonValueConverter (const Catalog_Namespace::Catalog &cat, size_t num_rows, const ColumnDescriptor *logicalColumnDescriptor)
 
 ~GeoMultiPolygonValueConverter () override
 
void allocateColumnarData (size_t num_rows) override
 
void convertToColumnarFormat (size_t row, const TargetValue *value) override
 
void addDataBlocksToInsertData (Fragmenter_Namespace::InsertData &insertData) override
 
- Public Member Functions inherited from GeoPointValueConverter
 GeoPointValueConverter (const Catalog_Namespace::Catalog &cat, size_t num_rows, const ColumnDescriptor *logicalColumnDescriptor)
 
 ~GeoPointValueConverter () override
 
ArrayDatum toCompressedCoords (const std::shared_ptr< std::vector< double >> &coords)
 
- Public Member Functions inherited from TargetValueConverter
 TargetValueConverter (const ColumnDescriptor *cd)
 
virtual ~TargetValueConverter ()
 
virtual void finalizeDataBlocksForInsertData ()
 

Public Attributes

const ColumnDescriptorring_sizes_column_descriptor_
 
const ColumnDescriptorring_sizes_solumn_descriptor_
 
const ColumnDescriptorbounds_column_descriptor_
 
std::unique_ptr< std::vector
< ArrayDatum > > 
ring_sizes_data_
 
std::unique_ptr< std::vector
< ArrayDatum > > 
poly_rings_data_
 
std::unique_ptr< std::vector
< ArrayDatum > > 
bounds_data_
 
boost_variant_accessor
< GeoMultiPolyTargetValue
GEO_MULTI_POLY_VALUE_ACCESSOR
 
- Public Attributes inherited from GeoPointValueConverter
const ColumnDescriptorcoords_column_descriptor_
 
std::unique_ptr< std::vector
< std::string > > 
column_data_
 
std::unique_ptr< std::vector
< ArrayDatum > > 
signed_compressed_coords_data_
 
boost_variant_accessor
< GeoTargetValue
GEO_VALUE_ACCESSOR
 
boost_variant_accessor
< GeoPointTargetValue
GEO_POINT_VALUE_ACCESSOR
 
- Public Attributes inherited from TargetValueConverter
const ColumnDescriptorcolumn_descriptor_
 
boost_variant_accessor
< ScalarTargetValue
SCALAR_TARGET_VALUE_ACCESSOR
 
boost_variant_accessor
< ArrayTargetValue
ARRAY_TARGET_VALUE_ACCESSOR
 
boost_variant_accessor
< GeoTargetValue
GEO_TARGET_VALUE_ACCESSOR
 
boost_variant_accessor
< NullableString
NULLABLE_STRING_ACCESSOR
 
boost_variant_accessor
< std::string > 
STRING_ACCESSOR
 

Detailed Description

Definition at line 1029 of file TargetValueConvertersImpl.h.

Constructor & Destructor Documentation

GeoMultiPolygonValueConverter::GeoMultiPolygonValueConverter ( const Catalog_Namespace::Catalog cat,
size_t  num_rows,
const ColumnDescriptor logicalColumnDescriptor 
)
inline

Definition at line 1038 of file TargetValueConvertersImpl.h.

References allocateColumnarData(), bounds_column_descriptor_, CHECK, TargetValueConverter::column_descriptor_, ColumnDescriptor::columnId, Catalog_Namespace::Catalog::getMetadataForColumn(), ring_sizes_column_descriptor_, ring_sizes_solumn_descriptor_, and ColumnDescriptor::tableId.

1041  : GeoPointValueConverter(cat, num_rows, logicalColumnDescriptor) {
1051 
1052  if (num_rows) {
1053  allocateColumnarData(num_rows);
1054  }
1055  }
const ColumnDescriptor * ring_sizes_solumn_descriptor_
void allocateColumnarData(size_t num_rows) override
const ColumnDescriptor * column_descriptor_
GeoPointValueConverter(const Catalog_Namespace::Catalog &cat, size_t num_rows, const ColumnDescriptor *logicalColumnDescriptor)
const ColumnDescriptor * bounds_column_descriptor_
const ColumnDescriptor * getMetadataForColumn(int tableId, const std::string &colName) const
#define CHECK(condition)
Definition: Logger.h:291
const ColumnDescriptor * ring_sizes_column_descriptor_

+ Here is the call graph for this function:

GeoMultiPolygonValueConverter::~GeoMultiPolygonValueConverter ( )
inlineoverride

Definition at line 1057 of file TargetValueConvertersImpl.h.

1057 {}

Member Function Documentation

void GeoMultiPolygonValueConverter::addDataBlocksToInsertData ( Fragmenter_Namespace::InsertData insertData)
inlineoverridevirtual

Reimplemented from GeoPointValueConverter.

Definition at line 1097 of file TargetValueConvertersImpl.h.

References GeoPointValueConverter::addDataBlocksToInsertData(), DataBlockPtr::arraysPtr, bounds_column_descriptor_, bounds_data_, ColumnDescriptor::columnId, Fragmenter_Namespace::InsertData::columnIds, Fragmenter_Namespace::InsertData::data, poly_rings_data_, ring_sizes_column_descriptor_, ring_sizes_data_, and ring_sizes_solumn_descriptor_.

1097  {
1099 
1100  DataBlockPtr ringSizes, polyRings, bounds;
1101 
1102  ringSizes.arraysPtr = ring_sizes_data_.get();
1103  polyRings.arraysPtr = poly_rings_data_.get();
1104  bounds.arraysPtr = bounds_data_.get();
1105 
1106  insertData.data.emplace_back(ringSizes);
1107  insertData.columnIds.emplace_back(ring_sizes_column_descriptor_->columnId);
1108 
1109  insertData.data.emplace_back(polyRings);
1110  insertData.columnIds.emplace_back(ring_sizes_solumn_descriptor_->columnId);
1111 
1112  insertData.data.emplace_back(bounds);
1113  insertData.columnIds.emplace_back(bounds_column_descriptor_->columnId);
1114  }
std::unique_ptr< std::vector< ArrayDatum > > ring_sizes_data_
std::unique_ptr< std::vector< ArrayDatum > > bounds_data_
const ColumnDescriptor * ring_sizes_solumn_descriptor_
std::vector< ArrayDatum > * arraysPtr
Definition: sqltypes.h:235
std::unique_ptr< std::vector< ArrayDatum > > poly_rings_data_
const ColumnDescriptor * bounds_column_descriptor_
std::vector< DataBlockPtr > data
the number of rows being inserted
Definition: Fragmenter.h:73
void addDataBlocksToInsertData(Fragmenter_Namespace::InsertData &insertData) override
const ColumnDescriptor * ring_sizes_column_descriptor_
std::vector< int > columnIds
identifies the table into which the data is being inserted
Definition: Fragmenter.h:71

+ Here is the call graph for this function:

void GeoMultiPolygonValueConverter::allocateColumnarData ( size_t  num_rows)
inlineoverridevirtual

Reimplemented from GeoPointValueConverter.

Definition at line 1059 of file TargetValueConvertersImpl.h.

References GeoPointValueConverter::allocateColumnarData(), bounds_data_, poly_rings_data_, and ring_sizes_data_.

Referenced by GeoMultiPolygonValueConverter().

1059  {
1061  ring_sizes_data_ = std::make_unique<std::vector<ArrayDatum>>(num_rows);
1062  poly_rings_data_ = std::make_unique<std::vector<ArrayDatum>>(num_rows);
1063  bounds_data_ = std::make_unique<std::vector<ArrayDatum>>(num_rows);
1064  }
std::unique_ptr< std::vector< ArrayDatum > > ring_sizes_data_
std::unique_ptr< std::vector< ArrayDatum > > bounds_data_
void allocateColumnarData(size_t num_rows) override
std::unique_ptr< std::vector< ArrayDatum > > poly_rings_data_

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void GeoMultiPolygonValueConverter::convertToColumnarFormat ( size_t  row,
const TargetValue value 
)
inlineoverridevirtual

Reimplemented from GeoPointValueConverter.

Definition at line 1068 of file TargetValueConvertersImpl.h.

References CHECK, compute_bounds_of_coords(), GEO_MULTI_POLY_VALUE_ACCESSOR, TargetValueConverter::GEO_TARGET_VALUE_ACCESSOR, NULL_ARRAY_DOUBLE, NULL_DOUBLE, to_array_datum(), and GeoPointValueConverter::toCompressedCoords().

1068  {
1069  const auto geoValue =
1070  checked_get<GeoTargetValue>(row, value, GEO_TARGET_VALUE_ACCESSOR);
1071  CHECK(geoValue);
1072  if (geoValue->is_initialized()) {
1073  const auto geo = geoValue->get();
1074  const auto geoMultiPoly =
1075  checked_get<GeoMultiPolyTargetValue>(row, &geo, GEO_MULTI_POLY_VALUE_ACCESSOR);
1076 
1077  (*column_data_)[row] = "";
1078  (*signed_compressed_coords_data_)[row] = toCompressedCoords(geoMultiPoly->coords);
1079  (*ring_sizes_data_)[row] = to_array_datum(geoMultiPoly->ring_sizes);
1080  (*poly_rings_data_)[row] = to_array_datum(geoMultiPoly->poly_rings);
1081  auto bounds = compute_bounds_of_coords(geoMultiPoly->coords);
1082  (*bounds_data_)[row] = to_array_datum(bounds);
1083  } else {
1084  // NULL MultiPolygon
1085  (*column_data_)[row] = "";
1086  (*signed_compressed_coords_data_)[row] = ArrayDatum(0, nullptr, true);
1087  (*ring_sizes_data_)[row] = ArrayDatum(0, nullptr, true);
1088  (*poly_rings_data_)[row] = ArrayDatum(0, nullptr, true);
1089  std::vector<double> bounds = {
1090  NULL_ARRAY_DOUBLE, NULL_DOUBLE, NULL_DOUBLE, NULL_DOUBLE};
1091  auto bounds_datum = to_array_datum(bounds);
1092  bounds_datum.is_null = true;
1093  (*bounds_data_)[row] = bounds_datum;
1094  }
1095  }
ArrayDatum to_array_datum(const std::vector< ELEM_TYPE > &vector)
#define NULL_DOUBLE
ArrayDatum toCompressedCoords(const std::shared_ptr< std::vector< double >> &coords)
std::vector< double > compute_bounds_of_coords(const std::shared_ptr< std::vector< double >> &coords)
std::conditional_t< is_cuda_compiler(), DeviceArrayDatum, HostArrayDatum > ArrayDatum
Definition: sqltypes.h:229
boost_variant_accessor< GeoMultiPolyTargetValue > GEO_MULTI_POLY_VALUE_ACCESSOR
#define NULL_ARRAY_DOUBLE
#define CHECK(condition)
Definition: Logger.h:291
boost_variant_accessor< GeoTargetValue > GEO_TARGET_VALUE_ACCESSOR

+ Here is the call graph for this function:

Member Data Documentation

const ColumnDescriptor* GeoMultiPolygonValueConverter::bounds_column_descriptor_
std::unique_ptr<std::vector<ArrayDatum> > GeoMultiPolygonValueConverter::bounds_data_
boost_variant_accessor<GeoMultiPolyTargetValue> GeoMultiPolygonValueConverter::GEO_MULTI_POLY_VALUE_ACCESSOR

Definition at line 1066 of file TargetValueConvertersImpl.h.

Referenced by convertToColumnarFormat().

std::unique_ptr<std::vector<ArrayDatum> > GeoMultiPolygonValueConverter::poly_rings_data_
const ColumnDescriptor* GeoMultiPolygonValueConverter::ring_sizes_column_descriptor_
std::unique_ptr<std::vector<ArrayDatum> > GeoMultiPolygonValueConverter::ring_sizes_data_
const ColumnDescriptor* GeoMultiPolygonValueConverter::ring_sizes_solumn_descriptor_

The documentation for this struct was generated from the following file: