OmniSciDB  b24e664e58
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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_
 
const ColumnDescriptorrender_group_column_descriptor_
 
Importer_NS::RenderGroupAnalyzer render_group_analyzer_
 
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_
 
std::unique_ptr< int32_t[]> render_group_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
< 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 764 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 776 of file TargetValueConvertersImpl.h.

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

779  : GeoPointValueConverter(cat, num_rows, logicalColumnDescriptor) {
792 
793  if (num_rows) {
795  }
796  }
const int8_t const int64_t * num_rows
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)
CHECK(cgen_state)
const ColumnDescriptor * bounds_column_descriptor_
const ColumnDescriptor * getMetadataForColumn(int tableId, const std::string &colName) const
const ColumnDescriptor * render_group_column_descriptor_
const ColumnDescriptor * ring_sizes_column_descriptor_

+ Here is the call graph for this function:

GeoMultiPolygonValueConverter::~GeoMultiPolygonValueConverter ( )
inlineoverride

Definition at line 798 of file TargetValueConvertersImpl.h.

798 {}

Member Function Documentation

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

Reimplemented from GeoPointValueConverter.

Definition at line 825 of file TargetValueConvertersImpl.h.

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

825  {
827 
828  DataBlockPtr ringSizes, polyRings, bounds, renderGroup;
829 
830  ringSizes.arraysPtr = ring_sizes_data_.get();
831  polyRings.arraysPtr = poly_rings_data_.get();
832  bounds.arraysPtr = bounds_data_.get();
833  renderGroup.numbersPtr = reinterpret_cast<int8_t*>(render_group_data_.get());
834 
835  insertData.data.emplace_back(ringSizes);
836  insertData.columnIds.emplace_back(ring_sizes_column_descriptor_->columnId);
837 
838  insertData.data.emplace_back(polyRings);
839  insertData.columnIds.emplace_back(ring_sizes_solumn_descriptor_->columnId);
840 
841  insertData.data.emplace_back(bounds);
842  insertData.columnIds.emplace_back(bounds_column_descriptor_->columnId);
843 
844  insertData.data.emplace_back(renderGroup);
845  insertData.columnIds.emplace_back(render_group_column_descriptor_->columnId);
846  }
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:142
std::unique_ptr< int32_t[]> render_group_data_
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:64
const ColumnDescriptor * render_group_column_descriptor_
void addDataBlocksToInsertData(Fragmenter_Namespace::InsertData &insertData) override
int8_t * numbersPtr
Definition: sqltypes.h:140
const ColumnDescriptor * ring_sizes_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:

void GeoMultiPolygonValueConverter::allocateColumnarData ( size_t  num_rows)
inlineoverridevirtual

Reimplemented from GeoPointValueConverter.

Definition at line 800 of file TargetValueConvertersImpl.h.

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

Referenced by GeoMultiPolygonValueConverter().

800  {
802  ring_sizes_data_ = std::make_unique<std::vector<ArrayDatum>>(num_rows);
803  poly_rings_data_ = std::make_unique<std::vector<ArrayDatum>>(num_rows);
804  bounds_data_ = std::make_unique<std::vector<ArrayDatum>>(num_rows);
805  render_group_data_ = std::make_unique<int32_t[]>(num_rows);
806  }
std::unique_ptr< std::vector< ArrayDatum > > ring_sizes_data_
std::unique_ptr< std::vector< ArrayDatum > > bounds_data_
const int8_t const int64_t * num_rows
std::unique_ptr< int32_t[]> render_group_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 810 of file TargetValueConvertersImpl.h.

References compute_bounds_of_coords(), GEO_MULTI_POLY_VALUE_ACCESSOR, TargetValueConverter::GEO_TARGET_VALUE_ACCESSOR, Importer_NS::RenderGroupAnalyzer::insertBoundsAndReturnRenderGroup(), render_group_analyzer_, render_group_data_, to_array_datum(), and GeoPointValueConverter::toCompressedCoords().

810  {
811  auto geoValue = checked_get<GeoTargetValue>(row, value, GEO_TARGET_VALUE_ACCESSOR);
812  auto geoMultiPoly = checked_get<GeoMultiPolyTargetValue>(
813  row, geoValue, GEO_MULTI_POLY_VALUE_ACCESSOR);
814 
815  (*column_data_)[row] = "";
816  (*signed_compressed_coords_data_)[row] = toCompressedCoords(geoMultiPoly->coords);
817  (*ring_sizes_data_)[row] = to_array_datum(geoMultiPoly->ring_sizes);
818  (*poly_rings_data_)[row] = to_array_datum(geoMultiPoly->poly_rings);
819  auto bounds = compute_bounds_of_coords(geoMultiPoly->coords);
820  (*bounds_data_)[row] = to_array_datum(bounds);
821  render_group_data_[row] =
823  }
ArrayDatum to_array_datum(const std::vector< ELEM_TYPE > &vector)
std::unique_ptr< int32_t[]> render_group_data_
int insertBoundsAndReturnRenderGroup(const std::vector< double > &bounds)
Definition: Importer.cpp:4988
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< GeoMultiPolyTargetValue > GEO_MULTI_POLY_VALUE_ACCESSOR
Importer_NS::RenderGroupAnalyzer render_group_analyzer_
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_

Definition at line 773 of file TargetValueConvertersImpl.h.

Referenced by addDataBlocksToInsertData(), and allocateColumnarData().

boost_variant_accessor<GeoMultiPolyTargetValue> GeoMultiPolygonValueConverter::GEO_MULTI_POLY_VALUE_ACCESSOR

Definition at line 808 of file TargetValueConvertersImpl.h.

Referenced by convertToColumnarFormat().

std::unique_ptr<std::vector<ArrayDatum> > GeoMultiPolygonValueConverter::poly_rings_data_

Definition at line 772 of file TargetValueConvertersImpl.h.

Referenced by addDataBlocksToInsertData(), and allocateColumnarData().

Importer_NS::RenderGroupAnalyzer GeoMultiPolygonValueConverter::render_group_analyzer_

Definition at line 769 of file TargetValueConvertersImpl.h.

Referenced by convertToColumnarFormat().

const ColumnDescriptor* GeoMultiPolygonValueConverter::render_group_column_descriptor_
std::unique_ptr<int32_t[]> GeoMultiPolygonValueConverter::render_group_data_
const ColumnDescriptor* GeoMultiPolygonValueConverter::ring_sizes_column_descriptor_
std::unique_ptr<std::vector<ArrayDatum> > GeoMultiPolygonValueConverter::ring_sizes_data_

Definition at line 771 of file TargetValueConvertersImpl.h.

Referenced by addDataBlocksToInsertData(), and allocateColumnarData().

const ColumnDescriptor* GeoMultiPolygonValueConverter::ring_sizes_solumn_descriptor_

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