OmniSciDB  bf83d84833
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
foreign_storage::ParquetGeospatialEncoder Class Reference

#include <ParquetGeospatialEncoder.h>

+ Inheritance diagram for foreign_storage::ParquetGeospatialEncoder:
+ Collaboration diagram for foreign_storage::ParquetGeospatialEncoder:

Public Member Functions

 ParquetGeospatialEncoder ()
 
 ParquetGeospatialEncoder (const parquet::ColumnDescriptor *parquet_column_descriptor, std::list< Chunk_NS::Chunk > &chunks, std::list< std::unique_ptr< ChunkMetadata >> &chunk_metadata)
 
void appendData (const int16_t *def_levels, const int16_t *rep_levels, const int64_t values_read, const int64_t levels_read, const bool is_last_batch, int8_t *values) override
 
- Public Member Functions inherited from foreign_storage::ParquetEncoder
 ParquetEncoder (Data_Namespace::AbstractBuffer *buffer)
 
virtual ~ParquetEncoder ()=default
 
virtual std::shared_ptr
< ChunkMetadata
getRowGroupMetadata (const parquet::RowGroupMetaData *group_metadata, const int parquet_column_index, const SQLTypeInfo &column_type)
 

Private Types

enum  GeoColumnType {
  COORDS, BOUNDS, RING_SIZES, POLY_RINGS,
  RENDER_GROUP
}
 

Private Member Functions

void appendBaseAndRenderGroupDataAndUpdateMetadata (const int64_t levels_read)
 
void validateChunksAndMetadataSizing (std::list< Chunk_NS::Chunk > &chunks, 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)
 

Static Private Member Functions

static void throwMalformedGeoElement (const size_t row_count, const std::string &omnisci_column_name)
 
static void throwMismatchedGeoElement (const std::string &omnisci_column_name)
 

Private Attributes

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< int32_t > render_group_values_
 
std::vector< std::string > base_values_
 
size_t row_count_
 
std::string parquet_column_name_
 
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_
 

Static Private Attributes

static constexpr bool PROMOTE_POLYGON_TO_MULTIPOLYGON = true
 

Additional Inherited Members

- Static Protected Member Functions inherited from foreign_storage::ParquetEncoder
static std::shared_ptr
< ChunkMetadata
createMetadata (const SQLTypeInfo &column_type)
 
static void throwNotNullViolation (const std::string &parquet_column_name)
 
static void validateNullCount (const std::string &parquet_column_name, int64_t null_count, const SQLTypeInfo &column_type)
 
- Protected Attributes inherited from foreign_storage::ParquetEncoder
Data_Namespace::AbstractBufferbuffer_
 

Detailed Description

Definition at line 46 of file ParquetGeospatialEncoder.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

foreign_storage::ParquetGeospatialEncoder::ParquetGeospatialEncoder ( )
inline

Definition at line 48 of file ParquetGeospatialEncoder.h.

48 : ParquetEncoder(nullptr) {}
ParquetEncoder(Data_Namespace::AbstractBuffer *buffer)
foreign_storage::ParquetGeospatialEncoder::ParquetGeospatialEncoder ( const parquet::ColumnDescriptor *  parquet_column_descriptor,
std::list< Chunk_NS::Chunk > &  chunks,
std::list< std::unique_ptr< ChunkMetadata >> &  chunk_metadata 
)
inline

Definition at line 50 of file ParquetGeospatialEncoder.h.

References base_column_encoder_, base_column_metadata_, BOUNDS, bounds_column_descriptor_, bounds_column_encoder_, bounds_column_metadata_, CHECK, ColumnDescriptor::columnType, COORDS, coords_column_descriptor_, coords_column_encoder_, coords_column_metadata_, geo_column_descriptor_, SQLTypeInfo::get_type(), initEncoderAndGetEncoderAndMetadata(), SQLTypeInfo::is_geometry(), kLINESTRING, kMULTIPOLYGON, kPOLYGON, POLY_RINGS, poly_rings_column_descriptor_, poly_rings_column_encoder_, poly_rings_column_metadata_, RENDER_GROUP, render_group_column_descriptor_, render_group_column_encoder_, render_group_column_metadata_, RING_SIZES, ring_sizes_column_descriptor_, ring_sizes_column_encoder_, ring_sizes_column_metadata_, and validateChunksAndMetadataSizing().

53  : ParquetEncoder(nullptr)
54  , geo_column_descriptor_(chunks.begin()->getColumnDesc())
55  , base_column_encoder_(nullptr)
56  , coords_column_encoder_(nullptr)
57  , bounds_column_encoder_(nullptr)
61  , base_column_metadata_(nullptr)
62  , coords_column_metadata_(nullptr)
63  , bounds_column_metadata_(nullptr)
69  , row_count_(0)
70  , parquet_column_name_(parquet_column_descriptor->name()) {
72 
73  validateChunksAndMetadataSizing(chunks, chunk_metadata);
74 
75  const auto geo_column_type = geo_column_descriptor_->columnType.get_type();
76  std::shared_ptr<ParquetScalarEncoder> null_scalar_encoder;
77 
78  // initialize base column encoder
79  auto base_chunk = chunks.begin();
80  base_chunk->initEncoder();
82  dynamic_cast<StringNoneEncoder*>(base_chunk->getBuffer()->getEncoder());
83  base_column_metadata_ = chunk_metadata.begin()->get();
85 
86  // initialize coords column
89  chunks, chunk_metadata, geo_column_type, COORDS);
90 
91  // initialize bounds column
92  if (geo_column_type == kLINESTRING || geo_column_type == kPOLYGON ||
93  geo_column_type == kMULTIPOLYGON) {
94  std::tie(
97  chunks, chunk_metadata, geo_column_type, BOUNDS);
98  }
99 
100  // initialize ring sizes column & render group column
101  if (geo_column_type == kPOLYGON || geo_column_type == kMULTIPOLYGON) {
106  chunks, chunk_metadata, geo_column_type, RING_SIZES);
111  chunks, chunk_metadata, geo_column_type, RENDER_GROUP);
112  }
113 
114  // initialize poly rings column
115  if (geo_column_type == kMULTIPOLYGON) {
120  chunks, chunk_metadata, geo_column_type, POLY_RINGS);
121  }
122  }
ParquetEncoder(Data_Namespace::AbstractBuffer *buffer)
void validateChunksAndMetadataSizing(std::list< Chunk_NS::Chunk > &chunks, std::list< std::unique_ptr< ChunkMetadata >> &chunk_metadata) const
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:311
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)
#define CHECK(condition)
Definition: Logger.h:197
bool is_geometry() const
Definition: sqltypes.h:490
SQLTypeInfo columnType

+ Here is the call graph for this function:

Member Function Documentation

void foreign_storage::ParquetGeospatialEncoder::appendArrayDatumsToBufferAndUpdateMetadata ( )
inlineprivate

Definition at line 183 of file ParquetGeospatialEncoder.h.

References appendToArrayEncoderAndUpdateMetadata(), bounds_column_encoder_, bounds_column_metadata_, bounds_datum_buffer_, coords_column_encoder_, coords_column_metadata_, coords_datum_buffer_, poly_rings_column_encoder_, poly_rings_column_metadata_, poly_rings_datum_buffer_, ring_sizes_column_encoder_, ring_sizes_column_metadata_, and ring_sizes_datum_buffer_.

Referenced by appendData().

183  {
194  }
void appendToArrayEncoderAndUpdateMetadata(const std::vector< ArrayDatum > &datum_parse_buffer, Encoder *encoder, ChunkMetadata *chunk_metadata) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void foreign_storage::ParquetGeospatialEncoder::appendBaseAndRenderGroupDataAndUpdateMetadata ( const int64_t  levels_read)
inlineprivate

Definition at line 153 of file ParquetGeospatialEncoder.h.

References StringNoneEncoder::appendData(), Encoder::appendData(), base_column_encoder_, base_column_metadata_, base_values_, ColumnDescriptor::columnType, render_group_column_descriptor_, render_group_column_encoder_, render_group_column_metadata_, and render_group_values_.

Referenced by appendData().

153  {
154  // add nulls to base column & zeros to render group (if applicable)
156  *base_column_encoder_->appendData(&base_values_, 0, levels_read);
158  auto data_ptr = reinterpret_cast<int8_t*>(render_group_values_.data());
160  data_ptr, levels_read, render_group_column_descriptor_->columnType);
161  }
162  }
std::shared_ptr< ChunkMetadata > appendData(int8_t *&src_data, const size_t num_elems_to_append, const SQLTypeInfo &ti, const bool replicating=false, const int64_t offset=-1) override
SQLTypeInfo columnType
virtual std::shared_ptr< ChunkMetadata > appendData(int8_t *&src_data, const size_t num_elems_to_append, const SQLTypeInfo &ti, const bool replicating=false, const int64_t offset=-1)=0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void foreign_storage::ParquetGeospatialEncoder::appendData ( const int16_t *  def_levels,
const int16_t *  rep_levels,
const int64_t  values_read,
const int64_t  levels_read,
const bool  is_last_batch,
int8_t *  values 
)
inlineoverridevirtual

Implements foreign_storage::ParquetEncoder.

Definition at line 124 of file ParquetGeospatialEncoder.h.

References appendArrayDatumsToBufferAndUpdateMetadata(), appendBaseAndRenderGroupDataAndUpdateMetadata(), CHECK, clearDatumBuffers(), clearParseBuffers(), processGeoElement(), processNullGeoElement(), and row_count_.

129  {
130  auto parquet_data_ptr = reinterpret_cast<const parquet::ByteArray*>(values);
131 
133 
134  for (int64_t i = 0, j = 0; i < levels_read; ++i, ++row_count_) {
136  if (def_levels[i] == 0) {
138  } else {
139  CHECK(j < values_read);
140  auto& byte_array = parquet_data_ptr[j++];
141  auto geo_string_view = std::string_view{
142  reinterpret_cast<const char*>(byte_array.ptr), byte_array.len};
143  processGeoElement(geo_string_view);
144  }
145  }
146 
148 
150  }
void appendBaseAndRenderGroupDataAndUpdateMetadata(const int64_t levels_read)
void processGeoElement(std::string_view geo_string_view)
#define CHECK(condition)
Definition: Logger.h:197

+ Here is the call graph for this function:

void foreign_storage::ParquetGeospatialEncoder::appendToArrayEncoderAndUpdateMetadata ( const std::vector< ArrayDatum > &  datum_parse_buffer,
Encoder encoder,
ChunkMetadata chunk_metadata 
) const
inlineprivate

Definition at line 196 of file ParquetGeospatialEncoder.h.

References CHECK, and UNREACHABLE.

Referenced by appendArrayDatumsToBufferAndUpdateMetadata().

199  {
200  if (!encoder) {
201  CHECK(!chunk_metadata);
202  return;
203  }
204  if (auto fixed_len_array_encoder =
205  dynamic_cast<FixedLengthArrayNoneEncoder*>(encoder)) {
206  auto new_chunk_metadata = fixed_len_array_encoder->appendData(
207  &datum_parse_buffer, 0, datum_parse_buffer.size());
208  *chunk_metadata = *new_chunk_metadata;
209  } else if (auto array_encoder = dynamic_cast<ArrayNoneEncoder*>(encoder)) {
210  auto new_chunk_metadata = array_encoder->appendData(
211  &datum_parse_buffer, 0, datum_parse_buffer.size(), false);
212  *chunk_metadata = *new_chunk_metadata;
213  } else {
214  UNREACHABLE();
215  }
216  }
#define UNREACHABLE()
Definition: Logger.h:241
#define CHECK(condition)
Definition: Logger.h:197

+ Here is the caller graph for this function:

void foreign_storage::ParquetGeospatialEncoder::clearDatumBuffers ( )
inlineprivate

Definition at line 303 of file ParquetGeospatialEncoder.h.

References bounds_datum_buffer_, coords_datum_buffer_, poly_rings_datum_buffer_, and ring_sizes_datum_buffer_.

Referenced by appendData().

303  {
304  coords_datum_buffer_.clear();
305  bounds_datum_buffer_.clear();
306  ring_sizes_datum_buffer_.clear();
307  poly_rings_datum_buffer_.clear();
308  }

+ Here is the caller graph for this function:

void foreign_storage::ParquetGeospatialEncoder::clearParseBuffers ( )
inlineprivate

Definition at line 296 of file ParquetGeospatialEncoder.h.

References bounds_parse_buffer_, coords_parse_buffer_, poly_rings_parse_buffer_, and ring_sizes_parse_buffer_.

Referenced by appendData().

+ Here is the caller graph for this function:

template<typename T >
std::list<T>::iterator foreign_storage::ParquetGeospatialEncoder::getIteratorForGeoColumnType ( std::list< T > &  list,
const SQLTypes  column_type,
const GeoColumnType  geo_column 
)
inlineprivate

Definition at line 313 of file ParquetGeospatialEncoder.h.

References BOUNDS, COORDS, kLINESTRING, kMULTIPOLYGON, kPOINT, kPOLYGON, POLY_RINGS, RENDER_GROUP, RING_SIZES, and UNREACHABLE.

Referenced by initEncoderAndGetEncoderAndMetadata().

316  {
317  auto list_iter = list.begin();
318  list_iter++; // skip base column
319  switch (column_type) {
320  case kPOINT: {
321  if (geo_column == COORDS) {
322  return list_iter;
323  }
324  UNREACHABLE();
325  }
326  case kLINESTRING: {
327  if (geo_column == COORDS) {
328  return list_iter;
329  }
330  list_iter++;
331  if (geo_column == BOUNDS) {
332  return list_iter;
333  }
334  UNREACHABLE();
335  }
336  case kPOLYGON: {
337  if (geo_column == COORDS) {
338  return list_iter;
339  }
340  list_iter++;
341  if (geo_column == RING_SIZES) {
342  return list_iter;
343  }
344  list_iter++;
345  if (geo_column == BOUNDS) {
346  return list_iter;
347  }
348  list_iter++;
349  if (geo_column == RENDER_GROUP) {
350  return list_iter;
351  }
352  UNREACHABLE();
353  }
354  case kMULTIPOLYGON: {
355  if (geo_column == COORDS) {
356  return list_iter;
357  }
358  list_iter++;
359  if (geo_column == RING_SIZES) {
360  return list_iter;
361  }
362  list_iter++;
363  if (geo_column == POLY_RINGS) {
364  return list_iter;
365  }
366  list_iter++;
367  if (geo_column == BOUNDS) {
368  return list_iter;
369  }
370  list_iter++;
371  if (geo_column == RENDER_GROUP) {
372  return list_iter;
373  }
374  UNREACHABLE();
375  }
376  default:
377  UNREACHABLE();
378  }
379  return {};
380  }
#define UNREACHABLE()
Definition: Logger.h:241

+ Here is the caller graph for this function:

std::tuple<Encoder*, ChunkMetadata*, const ColumnDescriptor*> foreign_storage::ParquetGeospatialEncoder::initEncoderAndGetEncoderAndMetadata ( std::list< Chunk_NS::Chunk > &  chunks,
std::list< std::unique_ptr< ChunkMetadata >> &  chunk_metadata,
const SQLTypes  sql_type,
GeoColumnType  geo_column_type 
)
inlineprivate

Definition at line 383 of file ParquetGeospatialEncoder.h.

References getIteratorForGeoColumnType().

Referenced by ParquetGeospatialEncoder().

387  {
388  auto chunk = getIteratorForGeoColumnType(chunks, sql_type, geo_column_type);
389  chunk->initEncoder();
390  auto encoder = chunk->getBuffer()->getEncoder();
391  auto metadata =
392  getIteratorForGeoColumnType(chunk_metadata, sql_type, geo_column_type)->get();
393  auto column_descriptor = chunk->getColumnDesc();
394  return {encoder, metadata, column_descriptor};
395  }
std::list< T >::iterator getIteratorForGeoColumnType(std::list< T > &list, const SQLTypes column_type, const GeoColumnType geo_column)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void foreign_storage::ParquetGeospatialEncoder::processGeoElement ( std::string_view  geo_string_view)
inlineprivate

Definition at line 218 of file ParquetGeospatialEncoder.h.

References bounds_column_encoder_, bounds_datum_buffer_, bounds_parse_buffer_, ColumnDescriptor::columnName, ColumnDescriptor::columnType, Geospatial::compress_coords(), coords_datum_buffer_, coords_parse_buffer_, foreign_storage::encode_as_array_datum(), geo_column_descriptor_, SQLTypeInfo::get_type(), Geospatial::GeoTypesFactory::getGeoColumns(), kMULTIPOLYGON, kPOLYGON, poly_rings_column_encoder_, poly_rings_datum_buffer_, poly_rings_parse_buffer_, PROMOTE_POLYGON_TO_MULTIPOLYGON, ring_sizes_column_encoder_, ring_sizes_datum_buffer_, ring_sizes_parse_buffer_, row_count_, throwMalformedGeoElement(), and throwMismatchedGeoElement().

Referenced by appendData().

218  {
220  if (!Geospatial::GeoTypesFactory::getGeoColumns(std::string(geo_string_view),
221  import_ti,
228  }
229 
230  // validate types
231  if (geo_column_descriptor_->columnType.get_type() != import_ti.get_type()) {
233  !(import_ti.get_type() == SQLTypes::kPOLYGON &&
236  }
237  }
238 
239  // append coords
240  std::vector<uint8_t> compressed_coords = Geospatial::compress_coords(
242  coords_datum_buffer_.emplace_back(encode_as_array_datum(compressed_coords));
243 
244  // append bounds
247  }
248 
249  // append ring sizes
251  ring_sizes_datum_buffer_.emplace_back(
253  }
254 
255  // append poly rings
257  poly_rings_datum_buffer_.emplace_back(
259  }
260  }
static void throwMismatchedGeoElement(const std::string &omnisci_column_name)
std::vector< uint8_t > compress_coords(std::vector< double > &coords, const SQLTypeInfo &ti)
Definition: Compression.cpp:52
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:311
static void throwMalformedGeoElement(const size_t row_count, const std::string &omnisci_column_name)
static bool getGeoColumns(const std::string &wkt_or_wkb_hex, SQLTypeInfo &ti, std::vector< double > &coords, std::vector< double > &bounds, std::vector< int > &ring_sizes, std::vector< int > &poly_rings, const bool promote_poly_to_mpoly=false)
Definition: Types.cpp:907
ArrayDatum encode_as_array_datum(const std::vector< T > &data)
SQLTypeInfo columnType
std::string columnName

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void foreign_storage::ParquetGeospatialEncoder::processNullGeoElement ( )
inlineprivate

Definition at line 262 of file ParquetGeospatialEncoder.h.

References bounds_column_descriptor_, bounds_column_encoder_, bounds_datum_buffer_, bounds_parse_buffer_, ColumnDescriptor::columnType, import_export::ImporterUtils::composeNullArray(), Geospatial::compress_coords(), coords_column_descriptor_, coords_datum_buffer_, coords_parse_buffer_, foreign_storage::encode_as_array_datum(), geo_column_descriptor_, SQLTypeInfo::get_type(), Geospatial::GeoTypesFactory::getNullGeoColumns(), kPOINT, poly_rings_column_descriptor_, poly_rings_column_encoder_, poly_rings_datum_buffer_, poly_rings_parse_buffer_, PROMOTE_POLYGON_TO_MULTIPOLYGON, ring_sizes_column_descriptor_, ring_sizes_column_encoder_, ring_sizes_datum_buffer_, and ring_sizes_parse_buffer_.

Referenced by appendData().

262  {
270  // POINT columns are represented using fixed length arrays and need
271  // special treatment of nulls
273  std::vector<uint8_t> compressed_coords = Geospatial::compress_coords(
275  coords_datum_buffer_.emplace_back(encode_as_array_datum(compressed_coords));
276  } else {
279  }
283  }
285  ring_sizes_datum_buffer_.emplace_back(
288  }
290  poly_rings_datum_buffer_.emplace_back(
293  }
294  }
std::vector< uint8_t > compress_coords(std::vector< double > &coords, const SQLTypeInfo &ti)
Definition: Compression.cpp:52
static ArrayDatum composeNullArray(const SQLTypeInfo &ti)
Definition: Importer.cpp:399
static void getNullGeoColumns(SQLTypeInfo &ti, std::vector< double > &coords, std::vector< double > &bounds, std::vector< int > &ring_sizes, std::vector< int > &poly_rings, const bool promote_poly_to_mpoly=false)
Definition: Types.cpp:1114
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:311
ArrayDatum encode_as_array_datum(const std::vector< T > &data)
SQLTypeInfo columnType

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void foreign_storage::ParquetGeospatialEncoder::throwMalformedGeoElement ( const size_t  row_count,
const std::string &  omnisci_column_name 
)
inlinestaticprivate

Definition at line 397 of file ParquetGeospatialEncoder.h.

References to_string().

Referenced by processGeoElement().

398  {
399  std::string error_message = "Failed to extract valid geometry in row " +
400  std::to_string(row_count) + " of OmniSci column '" +
401  omnisci_column_name + "'.";
402  throw foreign_storage::ForeignStorageException(error_message);
403  }
std::string to_string(char const *&&v)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void foreign_storage::ParquetGeospatialEncoder::throwMismatchedGeoElement ( const std::string &  omnisci_column_name)
inlinestaticprivate

Definition at line 405 of file ParquetGeospatialEncoder.h.

Referenced by processGeoElement().

405  {
407  "Imported geometry"
408  " doesn't match the geospatial type of OmniSci column '" +
409  omnisci_column_name + "'.");
410  }

+ Here is the caller graph for this function:

void foreign_storage::ParquetGeospatialEncoder::validateChunksAndMetadataSizing ( std::list< Chunk_NS::Chunk > &  chunks,
std::list< std::unique_ptr< ChunkMetadata >> &  chunk_metadata 
) const
inlineprivate

Definition at line 164 of file ParquetGeospatialEncoder.h.

References CHECK, ColumnDescriptor::columnType, geo_column_descriptor_, SQLTypeInfo::get_type(), kLINESTRING, kMULTIPOLYGON, kPOINT, and kPOLYGON.

Referenced by ParquetGeospatialEncoder().

166  {
167  const auto geo_column_type = geo_column_descriptor_->columnType.get_type();
168  if (geo_column_type == kPOINT) {
169  CHECK(chunk_metadata.size() == 2);
170  CHECK(chunks.size() == 2);
171  } else if (geo_column_type == kLINESTRING) {
172  CHECK(chunk_metadata.size() == 3);
173  CHECK(chunks.size() == 3);
174  } else if (geo_column_type == kPOLYGON) {
175  CHECK(chunk_metadata.size() == 5);
176  CHECK(chunks.size() == 5);
177  } else if (geo_column_type == kMULTIPOLYGON) {
178  CHECK(chunk_metadata.size() == 6);
179  CHECK(chunks.size() == 6);
180  }
181  }
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:311
#define CHECK(condition)
Definition: Logger.h:197
SQLTypeInfo columnType

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

StringNoneEncoder* foreign_storage::ParquetGeospatialEncoder::base_column_encoder_
private
ChunkMetadata* foreign_storage::ParquetGeospatialEncoder::base_column_metadata_
private
std::vector<std::string> foreign_storage::ParquetGeospatialEncoder::base_values_
private
const ColumnDescriptor* foreign_storage::ParquetGeospatialEncoder::bounds_column_descriptor_
private

Definition at line 431 of file ParquetGeospatialEncoder.h.

Referenced by ParquetGeospatialEncoder(), and processNullGeoElement().

Encoder* foreign_storage::ParquetGeospatialEncoder::bounds_column_encoder_
private
ChunkMetadata* foreign_storage::ParquetGeospatialEncoder::bounds_column_metadata_
private
std::vector<ArrayDatum> foreign_storage::ParquetGeospatialEncoder::bounds_datum_buffer_
private
std::vector<double> foreign_storage::ParquetGeospatialEncoder::bounds_parse_buffer_
private
const ColumnDescriptor* foreign_storage::ParquetGeospatialEncoder::coords_column_descriptor_
private

Definition at line 430 of file ParquetGeospatialEncoder.h.

Referenced by ParquetGeospatialEncoder(), and processNullGeoElement().

Encoder* foreign_storage::ParquetGeospatialEncoder::coords_column_encoder_
private
ChunkMetadata* foreign_storage::ParquetGeospatialEncoder::coords_column_metadata_
private
std::vector<ArrayDatum> foreign_storage::ParquetGeospatialEncoder::coords_datum_buffer_
private
std::vector<double> foreign_storage::ParquetGeospatialEncoder::coords_parse_buffer_
private
const ColumnDescriptor* foreign_storage::ParquetGeospatialEncoder::geo_column_descriptor_
private
std::string foreign_storage::ParquetGeospatialEncoder::parquet_column_name_
private

Definition at line 439 of file ParquetGeospatialEncoder.h.

const ColumnDescriptor* foreign_storage::ParquetGeospatialEncoder::poly_rings_column_descriptor_
private

Definition at line 433 of file ParquetGeospatialEncoder.h.

Referenced by ParquetGeospatialEncoder(), and processNullGeoElement().

Encoder* foreign_storage::ParquetGeospatialEncoder::poly_rings_column_encoder_
private
ChunkMetadata* foreign_storage::ParquetGeospatialEncoder::poly_rings_column_metadata_
private
std::vector<ArrayDatum> foreign_storage::ParquetGeospatialEncoder::poly_rings_datum_buffer_
private
std::vector<int> foreign_storage::ParquetGeospatialEncoder::poly_rings_parse_buffer_
private
constexpr bool foreign_storage::ParquetGeospatialEncoder::PROMOTE_POLYGON_TO_MULTIPOLYGON = true
staticprivate

Definition at line 414 of file ParquetGeospatialEncoder.h.

Referenced by processGeoElement(), and processNullGeoElement().

const ColumnDescriptor* foreign_storage::ParquetGeospatialEncoder::render_group_column_descriptor_
private
Encoder* foreign_storage::ParquetGeospatialEncoder::render_group_column_encoder_
private
ChunkMetadata* foreign_storage::ParquetGeospatialEncoder::render_group_column_metadata_
private
std::vector<int32_t> foreign_storage::ParquetGeospatialEncoder::render_group_values_
private
const ColumnDescriptor* foreign_storage::ParquetGeospatialEncoder::ring_sizes_column_descriptor_
private

Definition at line 432 of file ParquetGeospatialEncoder.h.

Referenced by ParquetGeospatialEncoder(), and processNullGeoElement().

Encoder* foreign_storage::ParquetGeospatialEncoder::ring_sizes_column_encoder_
private
ChunkMetadata* foreign_storage::ParquetGeospatialEncoder::ring_sizes_column_metadata_
private
std::vector<ArrayDatum> foreign_storage::ParquetGeospatialEncoder::ring_sizes_datum_buffer_
private
std::vector<int> foreign_storage::ParquetGeospatialEncoder::ring_sizes_parse_buffer_
private
size_t foreign_storage::ParquetGeospatialEncoder::row_count_
private

Definition at line 438 of file ParquetGeospatialEncoder.h.

Referenced by appendData(), and processGeoElement().


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