OmniSciDB  29e35f4d58
GeoLinestringValueConverter Struct Reference

#include <TargetValueConvertersImpl.h>

+ Inheritance diagram for GeoLinestringValueConverter:
+ Collaboration diagram for GeoLinestringValueConverter:

Public Member Functions

 GeoLinestringValueConverter (const Catalog_Namespace::Catalog &cat, size_t num_rows, const ColumnDescriptor *logicalColumnDescriptor)
 
 ~GeoLinestringValueConverter () 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 ColumnDescriptorbounds_column_descriptor_
 
std::unique_ptr< std::vector< ArrayDatum > > bounds_data_
 
boost_variant_accessor< GeoLineStringTargetValueGEO_LINESTRING_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< GeoPointTargetValueGEO_POINT_VALUE_ACCESSOR
 
- Public Attributes inherited from TargetValueConverter
const ColumnDescriptorcolumn_descriptor_
 
boost_variant_accessor< ScalarTargetValueSCALAR_TARGET_VALUE_ACCESSOR
 
boost_variant_accessor< ArrayTargetValueARRAY_TARGET_VALUE_ACCESSOR
 
boost_variant_accessor< GeoTargetValueGEO_TARGET_VALUE_ACCESSOR
 
boost_variant_accessor< NullableStringNULLABLE_STRING_ACCESSOR
 
boost_variant_accessor< std::string > STRING_ACCESSOR
 

Detailed Description

Definition at line 691 of file TargetValueConvertersImpl.h.

Constructor & Destructor Documentation

◆ GeoLinestringValueConverter()

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

Definition at line 696 of file TargetValueConvertersImpl.h.

References CHECK, and Catalog_Namespace::Catalog::getMetadataForColumn().

699  : GeoPointValueConverter(cat, num_rows, logicalColumnDescriptor) {
703 
704  if (num_rows) {
706  }
707  }
const int8_t const int64_t * num_rows
const ColumnDescriptor * column_descriptor_
const ColumnDescriptor * getMetadataForColumn(int tableId, const std::string &colName) const
GeoPointValueConverter(const Catalog_Namespace::Catalog &cat, size_t num_rows, const ColumnDescriptor *logicalColumnDescriptor)
#define CHECK(condition)
Definition: Logger.h:193
const ColumnDescriptor * bounds_column_descriptor_
void allocateColumnarData(size_t num_rows) override
+ Here is the call graph for this function:

◆ ~GeoLinestringValueConverter()

GeoLinestringValueConverter::~GeoLinestringValueConverter ( )
inlineoverride

Definition at line 709 of file TargetValueConvertersImpl.h.

709 {}

Member Function Documentation

◆ addDataBlocksToInsertData()

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

Reimplemented from GeoPointValueConverter.

Definition at line 730 of file TargetValueConvertersImpl.h.

References GeoPointValueConverter::addDataBlocksToInsertData(), DataBlockPtr::arraysPtr, ColumnDescriptor::columnId, Fragmenter_Namespace::InsertData::columnIds, and Fragmenter_Namespace::InsertData::data.

730  {
732 
733  DataBlockPtr bounds;
734 
735  bounds.arraysPtr = bounds_data_.get();
736 
737  insertData.data.emplace_back(bounds);
738  insertData.columnIds.emplace_back(bounds_column_descriptor_->columnId);
739  }
std::unique_ptr< std::vector< ArrayDatum > > bounds_data_
std::vector< ArrayDatum > * arraysPtr
Definition: sqltypes.h:142
std::vector< DataBlockPtr > data
the number of rows being inserted
Definition: Fragmenter.h:64
void addDataBlocksToInsertData(Fragmenter_Namespace::InsertData &insertData) override
const ColumnDescriptor * bounds_column_descriptor_
std::vector< int > columnIds
identifies the table into which the data is being inserted
Definition: Fragmenter.h:62
+ Here is the call graph for this function:

◆ allocateColumnarData()

void GeoLinestringValueConverter::allocateColumnarData ( size_t  num_rows)
inlineoverridevirtual

Reimplemented from GeoPointValueConverter.

Definition at line 711 of file TargetValueConvertersImpl.h.

References GeoPointValueConverter::allocateColumnarData(), CHECK, and num_rows.

711  {
712  CHECK(num_rows > 0);
714  bounds_data_ = std::make_unique<std::vector<ArrayDatum>>(num_rows);
715  }
std::unique_ptr< std::vector< ArrayDatum > > bounds_data_
const int8_t const int64_t * num_rows
void allocateColumnarData(size_t num_rows) override
#define CHECK(condition)
Definition: Logger.h:193
+ Here is the call graph for this function:

◆ convertToColumnarFormat()

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

Reimplemented from GeoPointValueConverter.

Definition at line 719 of file TargetValueConvertersImpl.h.

References compute_bounds_of_coords(), and to_array_datum().

719  {
720  auto geoValue = checked_get<GeoTargetValue>(row, value, GEO_TARGET_VALUE_ACCESSOR);
721  auto geoLinestring = checked_get<GeoLineStringTargetValue>(
722  row, geoValue, GEO_LINESTRING_VALUE_ACCESSOR);
723 
724  (*column_data_)[row] = "";
725  (*signed_compressed_coords_data_)[row] = toCompressedCoords(geoLinestring->coords);
726  auto bounds = compute_bounds_of_coords(geoLinestring->coords);
727  (*bounds_data_)[row] = to_array_datum(bounds);
728  }
ArrayDatum to_array_datum(const std::vector< ELEM_TYPE > &vector)
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)
boost_variant_accessor< GeoLineStringTargetValue > GEO_LINESTRING_VALUE_ACCESSOR
boost_variant_accessor< GeoTargetValue > GEO_TARGET_VALUE_ACCESSOR
+ Here is the call graph for this function:

Member Data Documentation

◆ bounds_column_descriptor_

const ColumnDescriptor* GeoLinestringValueConverter::bounds_column_descriptor_

Definition at line 692 of file TargetValueConvertersImpl.h.

◆ bounds_data_

std::unique_ptr<std::vector<ArrayDatum> > GeoLinestringValueConverter::bounds_data_

Definition at line 694 of file TargetValueConvertersImpl.h.

◆ GEO_LINESTRING_VALUE_ACCESSOR

boost_variant_accessor<GeoLineStringTargetValue> GeoLinestringValueConverter::GEO_LINESTRING_VALUE_ACCESSOR

Definition at line 717 of file TargetValueConvertersImpl.h.


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