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

#include <TargetValueConvertersImpl.h>

+ Inheritance diagram for GeoMultiLinestringValueConverter:
+ Collaboration diagram for GeoMultiLinestringValueConverter:

Public Member Functions

 GeoMultiLinestringValueConverter (const Catalog_Namespace::Catalog &cat, size_t num_rows, const ColumnDescriptor *logicalColumnDescriptor)
 
 ~GeoMultiLinestringValueConverter () 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 ColumnDescriptorlinestring_sizes_column_descriptor_
 
const ColumnDescriptorbounds_column_descriptor_
 
std::unique_ptr< std::vector
< ArrayDatum > > 
linestring_sizes_data_
 
std::unique_ptr< std::vector
< ArrayDatum > > 
bounds_data_
 
boost_variant_accessor
< GeoMultiLineStringTargetValue
GEO_MULTILINESTRING_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 873 of file TargetValueConvertersImpl.h.

Constructor & Destructor Documentation

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

Definition at line 880 of file TargetValueConvertersImpl.h.

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

883  : GeoPointValueConverter(cat, num_rows, logicalColumnDescriptor) {
890 
891  if (num_rows) {
892  allocateColumnarData(num_rows);
893  }
894  }
const ColumnDescriptor * bounds_column_descriptor_
const ColumnDescriptor * linestring_sizes_column_descriptor_
const ColumnDescriptor * column_descriptor_
GeoPointValueConverter(const Catalog_Namespace::Catalog &cat, size_t num_rows, const ColumnDescriptor *logicalColumnDescriptor)
const ColumnDescriptor * getMetadataForColumn(int tableId, const std::string &colName) const
#define CHECK(condition)
Definition: Logger.h:291
void allocateColumnarData(size_t num_rows) override

+ Here is the call graph for this function:

GeoMultiLinestringValueConverter::~GeoMultiLinestringValueConverter ( )
inlineoverride

Definition at line 896 of file TargetValueConvertersImpl.h.

896 {}

Member Function Documentation

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

Reimplemented from GeoPointValueConverter.

Definition at line 937 of file TargetValueConvertersImpl.h.

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

937  {
939 
940  DataBlockPtr linestringSizes, bounds;
941 
942  linestringSizes.arraysPtr = linestring_sizes_data_.get();
943  bounds.arraysPtr = bounds_data_.get();
944 
945  insertData.data.emplace_back(linestringSizes);
946  insertData.columnIds.emplace_back(linestring_sizes_column_descriptor_->columnId);
947 
948  insertData.data.emplace_back(bounds);
949  insertData.columnIds.emplace_back(bounds_column_descriptor_->columnId);
950  }
std::vector< ArrayDatum > * arraysPtr
Definition: sqltypes.h:235
const ColumnDescriptor * bounds_column_descriptor_
const ColumnDescriptor * linestring_sizes_column_descriptor_
std::unique_ptr< std::vector< ArrayDatum > > linestring_sizes_data_
std::vector< DataBlockPtr > data
the number of rows being inserted
Definition: Fragmenter.h:73
void addDataBlocksToInsertData(Fragmenter_Namespace::InsertData &insertData) override
std::unique_ptr< std::vector< ArrayDatum > > bounds_data_
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 GeoMultiLinestringValueConverter::allocateColumnarData ( size_t  num_rows)
inlineoverridevirtual

Reimplemented from GeoPointValueConverter.

Definition at line 898 of file TargetValueConvertersImpl.h.

References GeoPointValueConverter::allocateColumnarData(), bounds_data_, CHECK, and linestring_sizes_data_.

Referenced by GeoMultiLinestringValueConverter().

898  {
899  CHECK(num_rows > 0);
901  linestring_sizes_data_ = std::make_unique<std::vector<ArrayDatum>>(num_rows);
902  bounds_data_ = std::make_unique<std::vector<ArrayDatum>>(num_rows);
903  }
void allocateColumnarData(size_t num_rows) override
std::unique_ptr< std::vector< ArrayDatum > > linestring_sizes_data_
#define CHECK(condition)
Definition: Logger.h:291
std::unique_ptr< std::vector< ArrayDatum > > bounds_data_

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Reimplemented from GeoPointValueConverter.

Definition at line 908 of file TargetValueConvertersImpl.h.

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

908  {
909  const auto geoValue =
910  checked_get<GeoTargetValue>(row, value, GEO_TARGET_VALUE_ACCESSOR);
911  CHECK(geoValue);
912  if (geoValue->is_initialized()) {
913  const auto geo = geoValue->get();
914  const auto geoMultiLinestring = checked_get<GeoMultiLineStringTargetValue>(
916 
917  (*column_data_)[row] = "";
918  (*signed_compressed_coords_data_)[row] =
919  toCompressedCoords(geoMultiLinestring->coords);
920  (*linestring_sizes_data_)[row] =
921  to_array_datum(geoMultiLinestring->linestring_sizes);
922  auto bounds = compute_bounds_of_coords(geoMultiLinestring->coords);
923  (*bounds_data_)[row] = to_array_datum(bounds);
924  } else {
925  // NULL MultiLinestring
926  (*column_data_)[row] = "";
927  (*signed_compressed_coords_data_)[row] = ArrayDatum(0, nullptr, true);
928  (*linestring_sizes_data_)[row] = ArrayDatum(0, nullptr, true);
929  std::vector<double> bounds = {
930  NULL_ARRAY_DOUBLE, NULL_DOUBLE, NULL_DOUBLE, NULL_DOUBLE};
931  auto bounds_datum = to_array_datum(bounds);
932  bounds_datum.is_null = true;
933  (*bounds_data_)[row] = bounds_datum;
934  }
935  }
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< GeoMultiLineStringTargetValue > GEO_MULTILINESTRING_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* GeoMultiLinestringValueConverter::bounds_column_descriptor_
std::unique_ptr<std::vector<ArrayDatum> > GeoMultiLinestringValueConverter::bounds_data_

Definition at line 878 of file TargetValueConvertersImpl.h.

Referenced by addDataBlocksToInsertData(), and allocateColumnarData().

boost_variant_accessor<GeoMultiLineStringTargetValue> GeoMultiLinestringValueConverter::GEO_MULTILINESTRING_VALUE_ACCESSOR

Definition at line 906 of file TargetValueConvertersImpl.h.

Referenced by convertToColumnarFormat().

const ColumnDescriptor* GeoMultiLinestringValueConverter::linestring_sizes_column_descriptor_
std::unique_ptr<std::vector<ArrayDatum> > GeoMultiLinestringValueConverter::linestring_sizes_data_

Definition at line 877 of file TargetValueConvertersImpl.h.

Referenced by addDataBlocksToInsertData(), and allocateColumnarData().


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