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

specifies the content in-memory of a row in the column metadata table More...

#include <ColumnDescriptor.h>

+ Collaboration diagram for ColumnDescriptor:

Public Member Functions

 ColumnDescriptor ()
 
 ColumnDescriptor (const int tableId, const int columnId, const std::string &columnName, const SQLTypeInfo columnType)
 
 ColumnDescriptor (const bool isGeoPhyCol)
 
std::string toString () const
 
std::string getDefaultValueLiteral () const
 

Public Attributes

int tableId
 
int columnId
 
std::string columnName
 
std::string sourceName
 
SQLTypeInfo columnType
 
std::string chunks
 
bool isSystemCol
 
bool isVirtualCol
 
std::string virtualExpr
 
bool isDeletedCol
 
bool isGeoPhyCol {false}
 
std::optional< std::string > default_value
 

Detailed Description

specifies the content in-memory of a row in the column metadata table

ColumnDescriptor

Definition at line 32 of file ColumnDescriptor.h.

Constructor & Destructor Documentation

ColumnDescriptor::ColumnDescriptor ( )
inline

Definition at line 46 of file ColumnDescriptor.h.

46 : isSystemCol(false), isVirtualCol(false), isDeletedCol(false) {}
ColumnDescriptor::ColumnDescriptor ( const int  tableId,
const int  columnId,
const std::string &  columnName,
const SQLTypeInfo  columnType 
)
inline

Definition at line 47 of file ColumnDescriptor.h.

51  : tableId(tableId)
55  , columnType(columnType)
56  , isSystemCol(false)
57  , isVirtualCol(false)
58  , isDeletedCol(false) {}
std::string sourceName
SQLTypeInfo columnType
std::string columnName
ColumnDescriptor::ColumnDescriptor ( const bool  isGeoPhyCol)
inline

Definition at line 59 of file ColumnDescriptor.h.

References isGeoPhyCol.

59  : ColumnDescriptor() {
60  this->isGeoPhyCol = isGeoPhyCol;
61  }

Member Function Documentation

std::string ColumnDescriptor::getDefaultValueLiteral ( ) const
inline

Definition at line 71 of file ColumnDescriptor.h.

References CHECK, columnType, default_value, SQLTypeInfo::get_subtype(), i, SQLTypeInfo::is_array(), is_datetime(), SQLTypeInfo::is_geometry(), SQLTypeInfo::is_string(), SQLTypeInfo::is_string_array(), SQLTypeInfo::is_time(), and split().

Referenced by Catalog_Namespace::Catalog::dumpCreateTable(), Catalog_Namespace::Catalog::dumpSchema(), and DBHandler::populateThriftColumnType().

71  {
72  // some preprocessing of strings, arrays and especially arrays of strings
73  CHECK(default_value.has_value());
75  return "\'" + default_value.value() + "\'";
76  } else if (columnType.is_array()) {
77  auto value = default_value.value();
78  CHECK(value.front() == '{' && value.back() == '}');
79  value = value.substr(1, value.length() - 2);
81  auto elements = split(value, ", ");
82  value = "ARRAY[";
83  for (size_t i = 0; i < elements.size(); ++i) {
84  value += "'" + elements[i] + "'";
85  if (i != elements.size() - 1) {
86  value += ", ";
87  }
88  }
89  value += "]";
90  } else {
91  value = "ARRAY[" + value + "]";
92  }
93  return value;
94  } else {
95  return default_value.value();
96  }
97  }
HOST DEVICE SQLTypes get_subtype() const
Definition: sqltypes.h:330
bool is_time() const
Definition: sqltypes.h:515
std::vector< std::string > split(std::string_view str, std::string_view delim, std::optional< size_t > maxsplit)
split apart a string into a vector of substrings
std::optional< std::string > default_value
#define CHECK(condition)
Definition: Logger.h:209
bool is_geometry() const
Definition: sqltypes.h:521
SQLTypeInfo columnType
bool is_string() const
Definition: sqltypes.h:509
bool is_string_array() const
Definition: sqltypes.h:510
bool is_array() const
Definition: sqltypes.h:517
constexpr auto is_datetime(SQLTypes type)
Definition: sqltypes.h:263

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string ColumnDescriptor::toString ( ) const
inline

Definition at line 63 of file ColumnDescriptor.h.

References columnId, columnName, columnType, default_value, tableId, and typeName().

63  {
64  return ::typeName(this) + "(tableId=" + ::toString(tableId) +
65  ", columnId=" + ::toString(columnId) +
66  ", columnName=" + ::toString(columnName) +
67  ", columnType=" + ::toString(columnType) +
68  ", defaultValue=" + ::toString(default_value) + ")";
69  }
std::optional< std::string > default_value
std::string typeName(const T *v)
Definition: toString.h:88
SQLTypeInfo columnType
std::string columnName
std::string toString() const

+ Here is the call graph for this function:

Member Data Documentation

std::string ColumnDescriptor::chunks

Definition at line 38 of file ColumnDescriptor.h.

Referenced by Catalog_Namespace::Catalog::buildMaps().

int ColumnDescriptor::columnId

Definition at line 34 of file ColumnDescriptor.h.

Referenced by foreign_storage::anonymous_namespace{AbstractTextFileDataWrapper.cpp}::add_placeholder_metadata(), Catalog_Namespace::Catalog::addColumn(), Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::addDataBlocksToInsertData(), NumericValueConverter< int64_t, TARGET_TYPE >::addDataBlocksToInsertData(), Fragmenter_Namespace::FixedLenArrayChunkConverter::addDataBlocksToInsertData(), Fragmenter_Namespace::StringChunkConverter::addDataBlocksToInsertData(), Fragmenter_Namespace::DateChunkConverter< BUFFER_DATA_TYPE >::addDataBlocksToInsertData(), DictionaryValueConverter< TARGET_TYPE >::addDataBlocksToInsertData(), StringValueConverter::addDataBlocksToInsertData(), ArrayValueConverter< ELEMENT_CONVERTER >::addDataBlocksToInsertData(), GeoPointValueConverter::addDataBlocksToInsertData(), GeoLinestringValueConverter::addDataBlocksToInsertData(), GeoPolygonValueConverter::addDataBlocksToInsertData(), GeoMultiPolygonValueConverter::addDataBlocksToInsertData(), Catalog_Namespace::Catalog::addTableToMap(), Parser::InsertStmt::analyze(), Parser::InsertValuesStmt::analyze(), Catalog_Namespace::Catalog::buildMaps(), Fragmenter_Namespace::copyColumnDataOfShard(), Catalog_Namespace::Catalog::createTable(), Catalog_Namespace::Catalog::dropColumn(), Parser::AddColumnStmt::execute(), Parser::DropColumnStmt::execute(), import_export::fill_missing_columns(), Catalog_Namespace::Catalog::gatherAdditionalInfo(), GeoLinestringValueConverter::GeoLinestringValueConverter(), GeoMultiPolygonValueConverter::GeoMultiPolygonValueConverter(), GeoPointValueConverter::GeoPointValueConverter(), GeoPolygonValueConverter::GeoPolygonValueConverter(), get_column_type(), foreign_storage::get_sub_type_column_descriptor(), Catalog_Namespace::Catalog::getDeletedColumnIfRowsDeleted(), TableOptimizer::getDeletedColumnStats(), import_export::Loader::getStringDict(), import_export::Importer::importDelimited(), import_export::Importer::importGDAL(), ColumnFetcher::linearizeFixedLenArrayColFrags(), ColumnFetcher::linearizeVarLenArrayColFrags(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::metadata_scan_rowgroup_interval(), anonymous_namespace{ExecutionKernel.cpp}::need_to_hold_chunk(), DBHandler::populateThriftColumnType(), TableOptimizer::recomputeColumnMetadata(), Catalog_Namespace::Catalog::renameColumn(), import_export::Importer::set_geo_physical_import_buffer(), import_export::Importer::set_geo_physical_import_buffer_columnar(), toString(), Fragmenter_Namespace::InsertOrderFragmenter::updateChunkStats(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumnChunkMetadata(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumnMetadata(), and TableOptimizer::vacuumFragments().

std::string ColumnDescriptor::columnName

Definition at line 35 of file ColumnDescriptor.h.

Referenced by import_export::TypedImportBuffer::add_arrow_values(), import_export::TypedImportBuffer::add_value(), import_export::TypedImportBuffer::add_values(), Catalog_Namespace::Catalog::addColumn(), import_export::TypedImportBuffer::addDefaultValues(), import_export::TypedImportBuffer::addDictEncodedString(), Catalog_Namespace::Catalog::addTableToMap(), Parser::InsertValuesStmt::analyze(), Parser::QuerySpec::analyze_select_clause(), foreign_storage::ParquetFixedLengthArrayEncoder::appendNullArrayOrCheckArraySize(), Catalog_Namespace::Catalog::buildMaps(), Catalog_Namespace::Catalog::createSystemTable(), Catalog_Namespace::Catalog::createTable(), Parser::InsertValuesStmt::determineLeafIndex(), Catalog_Namespace::Catalog::dropColumn(), Catalog_Namespace::Catalog::dumpCreateTable(), Catalog_Namespace::Catalog::dumpSchema(), anonymous_namespace{ArrowImporter.h}::error_context(), Parser::CreateDataframeStmt::execute(), Parser::AddColumnStmt::execute(), Parser::DropColumnStmt::execute(), Parser::CreateTableStmt::executeDryRun(), Catalog_Namespace::Catalog::expandGeoColumn(), import_export::fill_missing_columns(), DBHandler::fillGeoColumns(), Catalog_Namespace::Catalog::gatherAdditionalInfo(), import_export::Importer::gdalToColumnDescriptors(), foreign_storage::get_sub_type_column_descriptor(), Parser::LocalConnector::getColumnDescriptors(), Catalog_Namespace::Catalog::getDictionary(), import_export::Importer::importDelimited(), import_export::Importer::importGDAL(), anonymous_namespace{RelAlgExecutor.cpp}::insert_one_dict_str(), foreign_storage::TextFileBufferParser::isNullDatum(), Parser::InsertIntoTableAsSelectStmt::populateData(), DBHandler::populateThriftColumnType(), ArrowForeignStorage::prepareTable(), foreign_storage::GeospatialEncoder::processGeoElement(), TableOptimizer::recomputeColumnMetadata(), Catalog_Namespace::Catalog::removeTableFromMap(), Catalog_Namespace::Catalog::renameColumn(), ddl_utils::set_column_descriptor(), ddl_utils::set_default_encoding(), Catalog_Namespace::Catalog::setColumnDictionary(), Catalog_Namespace::Catalog::setColumnSharedDictionary(), foreign_storage::ParquetFixedLengthArrayEncoder::setNullFixedLengthArraySentinel(), Fragmenter_Namespace::sizeOfRawColumn(), toString(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_allowed_mapping(), ddl_utils::validate_and_set_array_size(), ddl_utils::validate_and_set_compressed_encoding(), ddl_utils::validate_and_set_date_encoding(), ddl_utils::validate_and_set_default_value(), ddl_utils::validate_and_set_dictionary_encoding(), ddl_utils::validate_and_set_encoding(), ddl_utils::validate_and_set_fixed_encoding(), ddl_utils::validate_and_set_none_encoding(), ddl_utils::validate_and_set_sparse_encoding(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_max_repetition_and_definition_level(), and validate_shared_dictionary().

SQLTypeInfo ColumnDescriptor::columnType

Definition at line 37 of file ColumnDescriptor.h.

Referenced by import_export::TypedImportBuffer::add_arrow_values(), foreign_storage::anonymous_namespace{AbstractTextFileDataWrapper.cpp}::add_placeholder_metadata(), import_export::TypedImportBuffer::add_value(), import_export::TypedImportBuffer::add_values(), Catalog_Namespace::Catalog::addColumn(), import_export::TypedImportBuffer::addDefaultValues(), import_export::TypedImportBuffer::addDictEncodedString(), import_export::TypedImportBuffer::addDictEncodedStringArray(), Catalog_Namespace::Catalog::addReferenceToForeignDict(), Parser::InsertStmt::analyze(), Parser::InsertValuesStmt::analyze(), foreign_storage::GeospatialEncoder::appendBaseAndRenderGroupDataAndUpdateMetadata(), Chunk_NS::Chunk::appendData(), ArrayValueConverter< ELEMENT_CONVERTER >::ArrayValueConverter(), Chunk_NS::Chunk::begin_iterator(), Catalog_Namespace::Catalog::buildMaps(), foreign_storage::cache_blocks(), import_export::TypedImportBuffer::clear(), CodeGenerator::codegenColVar(), Fragmenter_Namespace::FixedLenArrayChunkConverter::convertToColumnarFormat(), TargetValueConverterFactory::create(), ArrayConverterFactory< ELEMENT_FACTORY >::create(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::create_parquet_array_encoder(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::create_parquet_date_encoder(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::create_parquet_date_from_timestamp_encoder(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::create_parquet_decimal_encoder(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::create_parquet_floating_point_encoder(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::create_parquet_geospatial_encoder(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::create_parquet_integral_encoder(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::create_parquet_none_type_encoder(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::create_parquet_string_encoder(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::create_parquet_time_encoder(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::create_parquet_timestamp_encoder(), Chunk_NS::Chunk::createChunkBuffer(), ArrowForeignStorageBase::createDecimalColumn(), Catalog_Namespace::Catalog::createSystemTable(), Catalog_Namespace::Catalog::createTable(), anonymous_namespace{ArrowImporter.h}::data_conversion_error(), Catalog_Namespace::Catalog::delDictionary(), Parser::InsertValuesStmt::determineLeafIndex(), DictionaryValueConverter< TARGET_TYPE >::DictionaryValueConverter(), Catalog_Namespace::Catalog::doTruncateTable(), Catalog_Namespace::Catalog::dumpCreateTable(), Catalog_Namespace::Catalog::dumpSchema(), Parser::AddColumnStmt::execute(), Parser::DropColumnStmt::execute(), Catalog_Namespace::Catalog::expandGeoColumn(), import_export::fill_missing_columns(), DBHandler::fillGeoColumns(), Fragmenter_Namespace::FixedLenArrayChunkConverter::FixedLenArrayChunkConverter(), Catalog_Namespace::Catalog::gatherAdditionalInfo(), import_export::Importer::gdalToColumnDescriptors(), foreign_storage::GeospatialEncoder::GeospatialEncoder(), get_column_type(), foreign_storage::get_placeholder_metadata(), foreign_storage::Csv::get_placeholder_metadata(), foreign_storage::get_sub_type_column_descriptor(), import_export::TypedImportBuffer::getAsBytes(), Chunk_NS::Chunk::getChunkBuffer(), Executor::getColLazyFetchInfo(), Parser::LocalConnector::getColumnDescriptors(), Catalog_Namespace::Catalog::getColumnDictDirectory(), getDefaultValueLiteral(), Catalog_Namespace::Catalog::getDictionaryToColumnMapping(), import_export::TypedImportBuffer::getElementSize(), foreign_storage::ParquetArrayImportEncoder::getNullArrayDatum(), Chunk_NS::Chunk::getNumElemsForBytesInsertData(), import_export::Loader::getStringDict(), import_export::TypedImportBuffer::getStringDictBuffer(), import_export::TypedImportBuffer::getTypeInfo(), foreign_storage::GeospatialEncoder::hasBoundsColumn(), foreign_storage::GeospatialEncoder::hasPolyRingsColumn(), foreign_storage::GeospatialEncoder::hasRenderGroupColumn(), foreign_storage::GeospatialEncoder::hasRingSizesColumn(), import_export::Importer::importDelimited(), import_export::Importer::importGDAL(), Chunk_NS::Chunk::initEncoder(), anonymous_namespace{RelAlgExecutor.cpp}::insert_one_dict_str(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::is_microsecond_precision(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::is_millisecond_precision(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::is_nanosecond_precision(), Chunk_NS::Chunk::isChunkOnDevice(), Fragmenter_Namespace::isDatumVectorData(), foreign_storage::TextFileBufferParser::isNullDatum(), Fragmenter_Namespace::isStringVectorData(), foreign_storage::ParquetDataWrapper::loadBuffersUsingLazyParquetChunkLoader(), anonymous_namespace{ExecutionKernel.cpp}::need_to_hold_chunk(), Executor::needLinearizeAllFragments(), TextConverterFactory::operator()(), ArraysConverterFactory::operator()(), foreign_storage::ParquetFixedLengthArrayEncoder::ParquetFixedLengthArrayEncoder(), foreign_storage::ParquetGeospatialImportEncoder::ParquetGeospatialImportEncoder(), import_export::TypedImportBuffer::pop_value(), Parser::InsertIntoTableAsSelectStmt::populateData(), DBHandler::populateThriftColumnType(), ArrowForeignStorage::prepareTable(), foreign_storage::GeospatialEncoder::processGeoElement(), foreign_storage::GeospatialEncoder::processNullGeoElement(), foreign_storage::ParquetRowGroupReader::readAndValidateRowGroup(), TableOptimizer::recomputeColumnMetadata(), Catalog_Namespace::Catalog::removeTableFromMap(), Catalog_Namespace::Catalog::renameColumn(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::resize_values_buffer(), ddl_utils::set_column_descriptor(), ddl_utils::set_default_encoding(), import_export::Importer::set_geo_physical_import_buffer(), import_export::Importer::set_geo_physical_import_buffer_columnar(), Catalog_Namespace::Catalog::setColumnDictionary(), Catalog_Namespace::Catalog::setColumnSharedDictionary(), foreign_storage::ParquetFixedLengthArrayEncoder::setNullFixedLengthArraySentinel(), Fragmenter_Namespace::shuffleByIndexes(), Fragmenter_Namespace::sizeOfRawColumn(), foreign_storage::anonymous_namespace{AbstractTextFileDataWrapper.cpp}::skip_metadata_scan(), Fragmenter_Namespace::sortIndexes(), GeoPointValueConverter::toCompressedCoords(), toString(), RelAlgTranslator::translateGeoColumn(), anonymous_namespace{ArrowImporter.h}::type_conversion_error(), import_export::TypedImportBuffer::TypedImportBuffer(), Fragmenter_Namespace::InsertOrderFragmenter::updateChunkStats(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumnMetadata(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_allowed_mapping(), ddl_utils::validate_and_set_array_size(), ddl_utils::validate_and_set_compressed_encoding(), ddl_utils::validate_and_set_date_encoding(), ddl_utils::validate_and_set_default_value(), ddl_utils::validate_and_set_dictionary_encoding(), ddl_utils::validate_and_set_encoding(), ddl_utils::validate_and_set_fixed_encoding(), ddl_utils::validate_and_set_none_encoding(), ddl_utils::validate_and_set_sparse_encoding(), ddl_utils::validate_and_set_type(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_array_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_date_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_decimal_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_floating_point_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_geospatial_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_integral_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_max_repetition_and_definition_level(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_none_type_mapping(), Parser::anonymous_namespace{ParserNode.cpp}::validate_shard_column_type(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_string_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_time_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_timestamp_mapping(), foreign_storage::GeospatialEncoder::validateChunksSizing(), foreign_storage::GeospatialEncoder::validateMetadataSizing(), and import_export::TypedImportBuffer::~TypedImportBuffer().

bool ColumnDescriptor::isGeoPhyCol {false}
std::string ColumnDescriptor::sourceName
std::string ColumnDescriptor::virtualExpr

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