OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
data_conversion::StringViewToGeoEncoder Class Reference

#include <StringViewToGeoEncoder.h>

+ Inheritance diagram for data_conversion::StringViewToGeoEncoder:
+ Collaboration diagram for data_conversion::StringViewToGeoEncoder:

Public Member Functions

 StringViewToGeoEncoder (std::list< Chunk_NS::Chunk > &chunks, std::list< std::unique_ptr< ChunkMetadata >> &chunk_metadata, const bool error_tracking_enabled, const bool geo_validate_geometry)
 
void encodeAndAppendData (const int8_t *data, const size_t num_elements) override
 
- Public Member Functions inherited from data_conversion::BaseConvertEncoder
virtual ~BaseConvertEncoder ()
 
 BaseConvertEncoder (const bool error_tracking_enabled)
 
void initializeDeleteBuffer (const size_t size_hint)
 
virtual void finalize (const size_t rows_appended)
 
virtual std::shared_ptr
< ChunkMetadata
getMetadata (const Chunk_NS::Chunk &chunk) const
 
- Public Member Functions inherited from foreign_storage::GeospatialEncoder
virtual ~GeospatialEncoder ()=default
 
 GeospatialEncoder (const bool geo_validate_geometry)
 
 GeospatialEncoder (std::list< Chunk_NS::Chunk > &chunks, const bool geo_validate_geometry)
 
 GeospatialEncoder (std::list< Chunk_NS::Chunk > &chunks, std::list< std::unique_ptr< ChunkMetadata >> &chunk_metadata, const bool geo_validate_geometry)
 

Additional Inherited Members

- Protected Types inherited from foreign_storage::GeospatialEncoder
enum  GeoColumnType { COORDS, BOUNDS, RING_OR_LINE_SIZES, POLY_RINGS }
 
- Protected Member Functions inherited from data_conversion::BaseConvertEncoder
virtual void clear ()
 
template<typename DataType >
bool isNull (const DataType &typed_value)
 
- Protected Member Functions inherited from foreign_storage::GeospatialEncoder
void appendBaseDataAndUpdateMetadata (const int64_t row_count)
 
void validateChunksSizing (std::list< Chunk_NS::Chunk > &chunks) const
 
void validateMetadataSizing (std::list< std::unique_ptr< ChunkMetadata >> &chunk_metadata) const
 
void appendArrayDatumsToBufferAndUpdateMetadata ()
 
void appendToArrayEncoderAndUpdateMetadata (const std::vector< ArrayDatum > &datum_parse_buffer, Encoder *encoder, ChunkMetadata *chunk_metadata) const
 
void processGeoElement (std::string_view geo_string_view)
 
void processNullGeoElement ()
 
void clearParseBuffers ()
 
void clearDatumBuffers ()
 
template<typename T >
std::list< T >::iterator getIteratorForGeoColumnType (std::list< T > &list, const SQLTypes column_type, const GeoColumnType geo_column)
 
std::tuple< Encoder
*, ChunkMetadata *, const
ColumnDescriptor * > 
initEncoderAndGetEncoderAndMetadata (std::list< Chunk_NS::Chunk > &chunks, std::list< std::unique_ptr< ChunkMetadata >> &chunk_metadata, const SQLTypes sql_type, GeoColumnType geo_column_type)
 
const ColumnDescriptorgetColumnDescriptor (std::list< Chunk_NS::Chunk > &chunks, const SQLTypes sql_type, GeoColumnType geo_column_type)
 
bool hasBoundsColumn () const
 
bool hasRingOrLineSizesColumn () const
 
bool hasPolyRingsColumn () const
 
- Static Protected Member Functions inherited from foreign_storage::GeospatialEncoder
static void throwMalformedGeoElement (const std::string &omnisci_column_name)
 
static void throwMismatchedGeoElement (const std::string &omnisci_column_name)
 
- Protected Attributes inherited from data_conversion::BaseConvertEncoder
std::optional< std::vector
< bool > > 
delete_buffer_
 
const bool error_tracking_enabled_
 
bool has_nulls_
 
size_t num_elements_
 
- Protected Attributes inherited from foreign_storage::GeospatialEncoder
const ColumnDescriptorgeo_column_descriptor_
 
StringNoneEncoderbase_column_encoder_
 
Encodercoords_column_encoder_
 
Encoderbounds_column_encoder_
 
Encoderring_or_line_sizes_column_encoder_
 
Encoderpoly_rings_column_encoder_
 
ChunkMetadatabase_column_metadata_
 
ChunkMetadatacoords_column_metadata_
 
ChunkMetadatabounds_column_metadata_
 
ChunkMetadataring_or_line_sizes_column_metadata_
 
ChunkMetadatapoly_rings_column_metadata_
 
const ColumnDescriptorcoords_column_descriptor_
 
const ColumnDescriptorbounds_column_descriptor_
 
const ColumnDescriptorring_or_line_sizes_column_descriptor_
 
const ColumnDescriptorpoly_rings_column_descriptor_
 
std::vector< std::string > base_values_
 
std::vector< double > coords_parse_buffer_
 
std::vector< double > bounds_parse_buffer_
 
std::vector< int > ring_or_line_sizes_parse_buffer_
 
std::vector< int > poly_rings_parse_buffer_
 
std::vector< ArrayDatumcoords_datum_buffer_
 
std::vector< ArrayDatumbounds_datum_buffer_
 
std::vector< ArrayDatumring_or_line_sizes_datum_buffer_
 
std::vector< ArrayDatumpoly_rings_datum_buffer_
 
bool geo_validate_geometry_
 

Detailed Description

Definition at line 26 of file StringViewToGeoEncoder.h.

Constructor & Destructor Documentation

data_conversion::StringViewToGeoEncoder::StringViewToGeoEncoder ( std::list< Chunk_NS::Chunk > &  chunks,
std::list< std::unique_ptr< ChunkMetadata >> &  chunk_metadata,
const bool  error_tracking_enabled,
const bool  geo_validate_geometry 
)
inline

Definition at line 29 of file StringViewToGeoEncoder.h.

33  : BaseConvertEncoder(error_tracking_enabled)
35  chunk_metadata,
36  geo_validate_geometry) {}
BaseConvertEncoder(const bool error_tracking_enabled)

Member Function Documentation

void data_conversion::StringViewToGeoEncoder::encodeAndAppendData ( const int8_t *  data,
const size_t  num_elements 
)
inlineoverridevirtual

Implements data_conversion::BaseConvertEncoder.

Definition at line 38 of file StringViewToGeoEncoder.h.

References foreign_storage::GeospatialEncoder::appendArrayDatumsToBufferAndUpdateMetadata(), foreign_storage::GeospatialEncoder::appendBaseDataAndUpdateMetadata(), foreign_storage::GeospatialEncoder::clearDatumBuffers(), foreign_storage::GeospatialEncoder::clearParseBuffers(), data_conversion::BaseConvertEncoder::delete_buffer_, data_conversion::BaseConvertEncoder::error_tracking_enabled_, foreign_storage::GeospatialEncoder::processGeoElement(), and foreign_storage::GeospatialEncoder::processNullGeoElement().

38  {
39  auto geo_strings = reinterpret_cast<const std::string_view*>(data);
41 
42  for (size_t i = 0; i < num_elements; ++i) {
44  delete_buffer_->push_back(false);
45  }
47  auto& geo_string = geo_strings[i];
48  if (geo_string.empty()) {
50  } else {
51  try {
52  processGeoElement(geo_strings[i]); // this may throw, need to handle error
53  } catch (std::exception& except) {
55  throw;
56  } else {
59  delete_buffer_->back() = true;
60  }
61  }
62  }
63  }
64 
66  appendBaseDataAndUpdateMetadata(num_elements);
67  }
void processGeoElement(std::string_view geo_string_view)
std::optional< std::vector< bool > > delete_buffer_
void appendBaseDataAndUpdateMetadata(const int64_t row_count)

+ Here is the call graph for this function:


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