OmniSciDB  cde582ebc3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
foreign_storage::OdbcGeospatialEncoder Class Reference

#include <OdbcGeospatialEncoder.h>

+ Inheritance diagram for foreign_storage::OdbcGeospatialEncoder:
+ Collaboration diagram for foreign_storage::OdbcGeospatialEncoder:

Public Member Functions

 OdbcGeospatialEncoder (std::list< Chunk_NS::Chunk > &chunks, std::list< std::unique_ptr< ChunkMetadata >> &chunk_metadata, const RenderGroupAnalyzerMap *render_group_analyzer_map, const bool is_error_tracking_enabled, const SQLTypeInfo &sql_type_info)
 
void appendData (const std::vector< std::string > &geo_strings, std::optional< std::set< size_t >> &rejected_row_local_indices)
 
- Public Member Functions inherited from foreign_storage::GeospatialEncoder
virtual ~GeospatialEncoder ()=default
 
 GeospatialEncoder (const RenderGroupAnalyzerMap *render_group_analyzer_map)
 
 GeospatialEncoder (std::list< Chunk_NS::Chunk > &chunks, const RenderGroupAnalyzerMap *render_group_analyzer_map)
 
 GeospatialEncoder (std::list< Chunk_NS::Chunk > &chunks, std::list< std::unique_ptr< ChunkMetadata >> &chunk_metadata, const RenderGroupAnalyzerMap *render_group_analyzer_map)
 

Private Attributes

const SQLTypeInfo type_info_
 
const bool is_error_tracking_enabled_
 

Additional Inherited Members

- Protected Types inherited from foreign_storage::GeospatialEncoder
enum  GeoColumnType {
  COORDS, BOUNDS, RING_SIZES, POLY_RINGS,
  RENDER_GROUP
}
 
- Protected Member Functions inherited from foreign_storage::GeospatialEncoder
void appendBaseAndRenderGroupDataAndUpdateMetadata (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 hasRingSizesColumn () const
 
bool hasRenderGroupColumn () 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 foreign_storage::GeospatialEncoder
const ColumnDescriptorgeo_column_descriptor_
 
StringNoneEncoderbase_column_encoder_
 
Encodercoords_column_encoder_
 
Encoderbounds_column_encoder_
 
Encoderring_sizes_column_encoder_
 
Encoderpoly_rings_column_encoder_
 
Encoderrender_group_column_encoder_
 
ChunkMetadatabase_column_metadata_
 
ChunkMetadatacoords_column_metadata_
 
ChunkMetadatabounds_column_metadata_
 
ChunkMetadataring_sizes_column_metadata_
 
ChunkMetadatapoly_rings_column_metadata_
 
ChunkMetadatarender_group_column_metadata_
 
const ColumnDescriptorcoords_column_descriptor_
 
const ColumnDescriptorbounds_column_descriptor_
 
const ColumnDescriptorring_sizes_column_descriptor_
 
const ColumnDescriptorpoly_rings_column_descriptor_
 
const ColumnDescriptorrender_group_column_descriptor_
 
std::vector< std::string > base_values_
 
std::vector< double > coords_parse_buffer_
 
std::vector< double > bounds_parse_buffer_
 
std::vector< int > ring_sizes_parse_buffer_
 
std::vector< int > poly_rings_parse_buffer_
 
std::vector< ArrayDatumcoords_datum_buffer_
 
std::vector< ArrayDatumbounds_datum_buffer_
 
std::vector< ArrayDatumring_sizes_datum_buffer_
 
std::vector< ArrayDatumpoly_rings_datum_buffer_
 
std::vector< int32_t > render_group_value_buffer_
 
const RenderGroupAnalyzerMaprender_group_analyzer_map_
 
- Static Protected Attributes inherited from foreign_storage::GeospatialEncoder
static constexpr bool PROMOTE_POLYGON_TO_MULTIPOLYGON = true
 

Detailed Description

Definition at line 23 of file OdbcGeospatialEncoder.h.

Constructor & Destructor Documentation

foreign_storage::OdbcGeospatialEncoder::OdbcGeospatialEncoder ( std::list< Chunk_NS::Chunk > &  chunks,
std::list< std::unique_ptr< ChunkMetadata >> &  chunk_metadata,
const RenderGroupAnalyzerMap render_group_analyzer_map,
const bool  is_error_tracking_enabled,
const SQLTypeInfo sql_type_info 
)
inline

Definition at line 25 of file OdbcGeospatialEncoder.h.

30  : GeospatialEncoder(chunks, chunk_metadata, render_group_analyzer_map)
31  , type_info_(sql_type_info)
32  , is_error_tracking_enabled_(is_error_tracking_enabled) {}
GeospatialEncoder(const RenderGroupAnalyzerMap *render_group_analyzer_map)

Member Function Documentation

void foreign_storage::OdbcGeospatialEncoder::appendData ( const std::vector< std::string > &  geo_strings,
std::optional< std::set< size_t >> &  rejected_row_local_indices 
)
inline

Definition at line 34 of file OdbcGeospatialEncoder.h.

References foreign_storage::GeospatialEncoder::appendArrayDatumsToBufferAndUpdateMetadata(), foreign_storage::GeospatialEncoder::appendBaseAndRenderGroupDataAndUpdateMetadata(), CHECK, foreign_storage::GeospatialEncoder::clearDatumBuffers(), foreign_storage::GeospatialEncoder::clearParseBuffers(), SQLTypeInfo::get_notnull(), is_error_tracking_enabled_, foreign_storage::GeospatialEncoder::processGeoElement(), foreign_storage::GeospatialEncoder::processNullGeoElement(), and type_info_.

35  {
37  CHECK(rejected_row_local_indices.has_value());
38  }
40  int64_t num_rows = geo_strings.size();
41  for (int64_t i = 0; i < num_rows; ++i) {
43  auto const& geo_string = geo_strings[i];
44  if (geo_string.size()) {
45  try {
46  processGeoElement(geo_string);
47  } catch (const std::runtime_error& except) {
49  rejected_row_local_indices->insert(i);
52  } else {
53  throw except;
54  }
55  }
56  } else {
59  rejected_row_local_indices->insert(i);
60  }
61  }
62  }
65  }
void processGeoElement(std::string_view geo_string_view)
void appendBaseAndRenderGroupDataAndUpdateMetadata(const int64_t row_count)
#define CHECK(condition)
Definition: Logger.h:222
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:336

+ Here is the call graph for this function:

Member Data Documentation

const bool foreign_storage::OdbcGeospatialEncoder::is_error_tracking_enabled_
private

Definition at line 69 of file OdbcGeospatialEncoder.h.

Referenced by appendData().

const SQLTypeInfo foreign_storage::OdbcGeospatialEncoder::type_info_
private

Definition at line 68 of file OdbcGeospatialEncoder.h.

Referenced by appendData().


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