OmniSciDB  0264ff685a
SQLTypeInfo Class Reference

#include <sqltypes.h>

Public Member Functions

 SQLTypeInfo (SQLTypes t, int d, int s, bool n, EncodingType c, int p, SQLTypes st)
 
 SQLTypeInfo (SQLTypes t, int d, int s, bool n)
 
 SQLTypeInfo (SQLTypes t, int d, int s)
 
 SQLTypeInfo (SQLTypes t, bool n)
 
 SQLTypeInfo (SQLTypes t)
 
 SQLTypeInfo (SQLTypes t, bool n, EncodingType c)
 
 SQLTypeInfo ()
 
HOST DEVICE SQLTypes get_type () const
 
HOST DEVICE SQLTypes get_subtype () const
 
HOST DEVICE int get_dimension () const
 
int get_precision () const
 
HOST DEVICE int get_input_srid () const
 
HOST DEVICE int get_scale () const
 
HOST DEVICE int get_output_srid () const
 
HOST DEVICE bool get_notnull () const
 
HOST DEVICE EncodingType get_compression () const
 
HOST DEVICE int get_comp_param () const
 
HOST DEVICE int get_size () const
 
int get_logical_size () const
 
int get_physical_cols () const
 
int get_physical_coord_cols () const
 
bool has_bounds () const
 
bool has_render_group () const
 
HOST DEVICE void set_type (SQLTypes t)
 
HOST DEVICE void set_subtype (SQLTypes st)
 
void set_dimension (int d)
 
void set_precision (int d)
 
void set_input_srid (int d)
 
void set_scale (int s)
 
void set_output_srid (int s)
 
void set_notnull (bool n)
 
void set_size (int s)
 
void set_fixed_size ()
 
void set_compression (EncodingType c)
 
void set_comp_param (int p)
 
std::string get_type_name () const
 
std::string get_compression_name () const
 
std::string to_string () const
 
std::string get_buffer_name () const
 
bool is_string () const
 
bool is_string_array () const
 
bool is_integer () const
 
bool is_decimal () const
 
bool is_fp () const
 
bool is_number () const
 
bool is_time () const
 
bool is_boolean () const
 
bool is_array () const
 
bool is_varlen_array () const
 
bool is_fixlen_array () const
 
bool is_timeinterval () const
 
bool is_geometry () const
 
bool is_column () const
 
bool is_bytes () const
 
bool is_buffer () const
 
bool transforms () const
 
bool is_varlen () const
 
bool is_varlen_indeed () const
 
bool is_dict_encoded_string () const
 
bool is_dict_encoded_type () const
 
HOST DEVICE bool operator!= (const SQLTypeInfo &rhs) const
 
HOST DEVICE bool operator== (const SQLTypeInfo &rhs) const
 
int get_array_context_logical_size () const
 
HOST DEVICE void operator= (const SQLTypeInfo &rhs)
 
bool is_castable (const SQLTypeInfo &new_type_info) const
 
HOST DEVICE bool is_null (const Datum &d) const
 
HOST DEVICE bool is_null (const int8_t *val) const
 
HOST DEVICE bool is_null_fixlen_array (const int8_t *val, int array_size) const
 
HOST DEVICE bool is_null_point_coord_array (const int8_t *val, int array_size) const
 
SQLTypeInfo get_elem_type () const
 
SQLTypeInfo get_array_type () const
 
bool is_date_in_days () const
 
bool is_date () const
 
bool is_high_precision_timestamp () const
 
bool is_timestamp () const
 

Private Member Functions

HOST DEVICE int get_storage_size () const
 

Private Attributes

SQLTypes type
 
SQLTypes subtype
 
int dimension
 
int scale
 
bool notnull
 
EncodingType compression
 
int comp_param
 
int size
 

Static Private Attributes

static std::string type_name [kSQLTYPE_LAST]
 
static std::string comp_name [kENCODING_LAST]
 

Detailed Description

Definition at line 261 of file sqltypes.h.

Constructor & Destructor Documentation

◆ SQLTypeInfo() [1/7]

SQLTypeInfo::SQLTypeInfo ( SQLTypes  t,
int  d,
int  s,
bool  n,
EncodingType  c,
int  p,
SQLTypes  st 
)
inline

Definition at line 263 of file sqltypes.h.

264  : type(t)
265  , subtype(st)
266  , dimension(d)
267  , scale(s)
268  , notnull(n)
269  , compression(c)
270  , comp_param(p)
271  , size(get_storage_size()) {}
SQLTypes subtype
Definition: sqltypes.h:731
bool notnull
Definition: sqltypes.h:734
EncodingType compression
Definition: sqltypes.h:735
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:742
SQLTypes type
Definition: sqltypes.h:730
int comp_param
Definition: sqltypes.h:736
int dimension
Definition: sqltypes.h:732

◆ SQLTypeInfo() [2/7]

SQLTypeInfo::SQLTypeInfo ( SQLTypes  t,
int  d,
int  s,
bool  n 
)
inline

Definition at line 272 of file sqltypes.h.

273  : type(t)
274  , subtype(kNULLT)
275  , dimension(d)
276  , scale(s)
277  , notnull(n)
279  , comp_param(0)
280  , size(get_storage_size()) {}
SQLTypes subtype
Definition: sqltypes.h:731
bool notnull
Definition: sqltypes.h:734
EncodingType compression
Definition: sqltypes.h:735
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:742
SQLTypes type
Definition: sqltypes.h:730
int comp_param
Definition: sqltypes.h:736
int dimension
Definition: sqltypes.h:732

◆ SQLTypeInfo() [3/7]

SQLTypeInfo::SQLTypeInfo ( SQLTypes  t,
int  d,
int  s 
)
inline

Definition at line 281 of file sqltypes.h.

281 : SQLTypeInfo(t, d, s, false) {}

◆ SQLTypeInfo() [4/7]

SQLTypeInfo::SQLTypeInfo ( SQLTypes  t,
bool  n 
)
inline

Definition at line 282 of file sqltypes.h.

283  : type(t)
284  , subtype(kNULLT)
285  , dimension(0)
286  , scale(0)
287  , notnull(n)
289  , comp_param(0)
290  , size(get_storage_size()) {}
SQLTypes subtype
Definition: sqltypes.h:731
bool notnull
Definition: sqltypes.h:734
EncodingType compression
Definition: sqltypes.h:735
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:742
SQLTypes type
Definition: sqltypes.h:730
int comp_param
Definition: sqltypes.h:736
int dimension
Definition: sqltypes.h:732

◆ SQLTypeInfo() [5/7]

SQLTypeInfo::SQLTypeInfo ( SQLTypes  t)
inline

Definition at line 291 of file sqltypes.h.

291 : SQLTypeInfo(t, false) {}

◆ SQLTypeInfo() [6/7]

SQLTypeInfo::SQLTypeInfo ( SQLTypes  t,
bool  n,
EncodingType  c 
)
inline

Definition at line 292 of file sqltypes.h.

293  : type(t)
294  , subtype(kNULLT)
295  , dimension(0)
296  , scale(0)
297  , notnull(n)
298  , compression(c)
299  , comp_param(0)
300  , size(get_storage_size()) {}
SQLTypes subtype
Definition: sqltypes.h:731
bool notnull
Definition: sqltypes.h:734
EncodingType compression
Definition: sqltypes.h:735
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:742
SQLTypes type
Definition: sqltypes.h:730
int comp_param
Definition: sqltypes.h:736
int dimension
Definition: sqltypes.h:732

◆ SQLTypeInfo() [7/7]

SQLTypeInfo::SQLTypeInfo ( )
inline

Definition at line 301 of file sqltypes.h.

302  : type(kNULLT)
303  , subtype(kNULLT)
304  , dimension(0)
305  , scale(0)
306  , notnull(false)
308  , comp_param(0)
309  , size(0) {}
SQLTypes subtype
Definition: sqltypes.h:731
bool notnull
Definition: sqltypes.h:734
EncodingType compression
Definition: sqltypes.h:735
SQLTypes type
Definition: sqltypes.h:730
int comp_param
Definition: sqltypes.h:736
int dimension
Definition: sqltypes.h:732

Member Function Documentation

◆ get_array_context_logical_size()

int SQLTypeInfo::get_array_context_logical_size ( ) const
inline

Definition at line 538 of file sqltypes.h.

References kENCODING_DICT, kENCODING_FIXED, and kENCODING_NONE.

Referenced by ResultSet::makeVarlenTargetValue().

538  {
539  if (is_string()) {
540  auto comp_type(get_compression());
541  if (comp_type == kENCODING_DICT || comp_type == kENCODING_FIXED ||
542  comp_type == kENCODING_NONE) {
543  return sizeof(int32_t);
544  }
545  }
546  return get_logical_size();
547  }
bool is_string() const
Definition: sqltypes.h:478
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:319
int get_logical_size() const
Definition: sqltypes.h:322
+ Here is the caller graph for this function:

◆ get_array_type()

SQLTypeInfo SQLTypeInfo::get_array_type ( ) const
inline

Definition at line 701 of file sqltypes.h.

References kARRAY, and run_benchmark_import::type.

Referenced by Parser::OperExpr::normalize().

701  {
703  }
bool notnull
Definition: sqltypes.h:734
EncodingType compression
Definition: sqltypes.h:735
SQLTypes type
Definition: sqltypes.h:730
int comp_param
Definition: sqltypes.h:736
int dimension
Definition: sqltypes.h:732
+ Here is the caller graph for this function:

◆ get_buffer_name()

std::string SQLTypeInfo::get_buffer_name ( ) const
inline

Definition at line 467 of file sqltypes.h.

467  {
468  if (is_array())
469  return "Array";
470  if (is_bytes())
471  return "Bytes";
472  if (is_column())
473  return "Column";
474  assert(false);
475  return "";
476  }
bool is_array() const
Definition: sqltypes.h:486
bool is_bytes() const
Definition: sqltypes.h:492
bool is_column() const
Definition: sqltypes.h:491

◆ get_comp_param()

HOST DEVICE int SQLTypeInfo::get_comp_param ( ) const
inline

Definition at line 320 of file sqltypes.h.

Referenced by Analyzer::Expr::add_cast(), Analyzer::UOper::add_cast(), Analyzer::CaseExpr::add_cast(), Catalog_Namespace::Catalog::addColumn(), Catalog_Namespace::Catalog::addReferenceToForeignDict(), RelLogicalUnion::checkForMatchingMetaInfoTypes(), CodeGenerator::codegen(), CodeGenerator::codegenCastFromString(), CodeGenerator::codegenCompression(), Analyzer::BinOper::common_string_type(), Geospatial::compress_coord(), Geospatial::compress_coords(), Geospatial::compress_null_point(), DictionaryConverterFactory< TARGET_TYPE >::create(), Encoder::Create(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::create_parquet_decimal_encoder(), Catalog_Namespace::Catalog::createTable(), DateDaysOverflowValidator::DateDaysOverflowValidator(), decompress(), Catalog_Namespace::Catalog::delDictionary(), Parser::InsertValuesStmt::determineLeafIndex(), DictionaryValueConverter< TARGET_TYPE >::DictionaryValueConverter(), Geospatial::get_compression_scheme(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), get_logical_type_info(), Catalog_Namespace::Catalog::getColumnDictDirectory(), ArrowResultSetConverter::initializeColumnBuilder(), inline_fixed_encoding_null_val(), anonymous_namespace{RelAlgExecutor.cpp}::insert_one_dict_str(), Geospatial::is_null_point(), foreign_storage::ParquetDataWrapper::loadBuffersUsingLazyParquetChunkLoader(), Parser::OperExpr::normalize(), operator!=(), TextConverterFactory::operator()(), operator=(), operator==(), DBHandler::populateThriftColumnType(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), Catalog_Namespace::Catalog::removeTableFromMap(), Catalog_Namespace::Catalog::setColumnDictionary(), Catalog_Namespace::Catalog::setColumnSharedDictionary(), Analyzer::UOper::toString(), ThriftSerializers::type_info_to_thrift(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_date_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_time_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_timestamp_mapping(), and File_Namespace::FileBuffer::writeMetadata().

320 { return comp_param; }
int comp_param
Definition: sqltypes.h:736
+ Here is the caller graph for this function:

◆ get_compression()

HOST DEVICE EncodingType SQLTypeInfo::get_compression ( ) const
inline

Definition at line 319 of file sqltypes.h.

Referenced by Analyzer::Expr::add_cast(), Analyzer::Constant::add_cast(), Analyzer::UOper::add_cast(), Analyzer::CaseExpr::add_cast(), Catalog_Namespace::Catalog::addColumn(), Parser::InValues::analyze(), Parser::FunctionRef::analyze(), Parser::QuerySpec::analyze_group_by(), CodeGenerator::castArrayPointer(), ChunkIter_get_next(), ChunkIter_get_nth(), CodeGenerator::codegenCastFromString(), CodeGenerator::codegenCmp(), CodeGenerator::codegenCompression(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codgenAdjustFixedEncNull(), Analyzer::BinOper::common_string_type(), Geospatial::compress_coord(), Geospatial::compress_coords(), Geospatial::compress_null_point(), Encoder::Create(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::create_parquet_decimal_encoder(), Catalog_Namespace::Catalog::createTable(), DatumEqual(), decompress(), Analyzer::Expr::decompress(), Catalog_Namespace::Catalog::delDictionary(), encoding_to_thrift(), RelAlgExecutor::executeSimpleInsert(), extract_from_datum(), ChunkMetadata::fillChunkStats(), anonymous_namespace{ColumnarResults.cpp}::fixed_encoding_nullable_val(), Geospatial::get_compression_scheme(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), anonymous_namespace{TargetExprBuilder.cpp}::get_initial_agg_val(), get_logical_type_info(), Chunk_NS::Chunk::getChunkBuffer(), Parser::LocalConnector::getColumnDescriptors(), Catalog_Namespace::Catalog::getColumnDictDirectory(), Chunk_NS::Chunk::getNumElemsForBytesInsertData(), import_export::Loader::getStringDict(), ResultSet::getTargetValueFromBufferRowwise(), Chunk_NS::Chunk::initEncoder(), inline_fixed_encoding_null_val(), inline_int_null_val(), CgenState::inlineIntNull(), FixedLengthArrayNoneEncoder::is_null(), Geospatial::is_null_point(), is_real_str_or_array(), is_unsigned_type(), Fragmenter_Namespace::isStringVectorData(), ResultSet::makeVarlenTargetValue(), anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_arguments(), Parser::OperExpr::normalize(), null_val_bit_pattern(), numeric_type_name(), operator!=(), TextConverterFactory::operator()(), operator=(), operator==(), Parser::InsertIntoTableAsSelectStmt::populateData(), DBHandler::populateThriftColumnType(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), Catalog_Namespace::Catalog::removeTableFromMap(), anonymous_namespace{TableOptimizer.cpp}::set_metadata_from_results(), Fragmenter_Namespace::sizeOfRawColumn(), RelAlgTranslator::translateGeoLiteral(), import_export::TypedImportBuffer::TypedImportBuffer(), ExpressionRange::typeSupportsRange(), FixedLengthArrayNoneEncoder::update_elem_stats(), ArrayNoneEncoder::update_elem_stats(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), anonymous_namespace{InputMetadata.cpp}::uses_int_meta(), foreign_storage::ParquetDateInSecondsEncoder::validate(), ddl_utils::validate_and_set_array_size(), 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_integral_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_none_type_mapping(), 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(), and File_Namespace::FileBuffer::writeMetadata().

319 { return compression; }
EncodingType compression
Definition: sqltypes.h:735

◆ get_compression_name()

std::string SQLTypeInfo::get_compression_name ( ) const
inline

Definition at line 445 of file sqltypes.h.

Referenced by Analyzer::UOper::toString().

445 { return comp_name[(int)compression]; }
EncodingType compression
Definition: sqltypes.h:735
static std::string comp_name[kENCODING_LAST]
Definition: sqltypes.h:740
+ Here is the caller graph for this function:

◆ get_dimension()

HOST DEVICE int SQLTypeInfo::get_dimension ( ) const
inline

Definition at line 313 of file sqltypes.h.

Referenced by Catalog_Namespace::Catalog::addColumn(), Analyzer::BinOper::analyze_type_info(), Analyzer::Constant::cast_string(), Analyzer::Constant::cast_to_string(), CodeGenerator::codegenCast(), CodeGenerator::codegenCastBetweenTimestamps(), CodeGenerator::codegenDateTruncHighPrecisionTimestamps(), CodeGenerator::codegenExtractHighPrecisionTimestamps(), CodeGenerator::codgenAdjustFixedEncNull(), Analyzer::BinOper::common_numeric_type(), Analyzer::BinOper::common_string_type(), Catalog_Namespace::Catalog::createTable(), DatumToString(), Analyzer::Expr::decompress(), Analyzer::Constant::do_cast(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), anonymous_namespace{Execute.cpp}::get_hpt_overflow_underflow_safe_scaled_values(), get_logical_type_info(), anonymous_namespace{ExpressionRange.cpp}::getDateTimePrecisionCastRange(), DateTimeTranslator::getDateTruncConstantValue(), DateTimeTranslator::getExtractFromTimeConstantValue(), 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(), operator!=(), operator=(), operator==(), parse_numeric(), Parser::InsertIntoTableAsSelectStmt::populateData(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), StringToDatum(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_timestamp_mapping(), and File_Namespace::FileBuffer::writeMetadata().

313 { return dimension; }
int dimension
Definition: sqltypes.h:732
+ Here is the caller graph for this function:

◆ get_elem_type()

SQLTypeInfo SQLTypeInfo::get_elem_type ( ) const
inline

Definition at line 697 of file sqltypes.h.

References kNULLT.

Referenced by import_export::TypedImportBuffer::add_value(), Parser::FunctionRef::analyze(), anonymous_namespace{ResultSetIteration.cpp}::build_array_target_value(), CodeGenerator::codegenArrayBuff(), CodeGenerator::codegenFunctionOperCastArgs(), ArrayConverterFactory< ELEMENT_FACTORY >::create(), foreign_storage::ParquetEncoder::createMetadata(), DateDaysOverflowValidator::DateDaysOverflowValidator(), datum_to_string(), DecimalOverflowValidator::DecimalOverflowValidator(), Analyzer::Constant::do_cast(), ChunkMetadata::dump(), RelAlgExecutor::executeSimpleInsert(), get_bit_width(), anonymous_namespace{ExtensionsIR.cpp}::get_llvm_type_from_sql_array_type(), foreign_storage::get_sub_type_column_descriptor(), getLeafColumnRange(), foreign_storage::TypedParquetInPlaceEncoder< int64_t, int32_t >::getRowGroupMetadata(), is_castable(), foreign_storage::ParquetDataWrapper::loadBuffersUsingLazyParquetChunkLoader(), ResultSet::makeVarlenTargetValue(), anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_arguments(), import_export::NullArray(), NullAwareValidator< INNER_VALIDATOR >::NullAwareValidator(), ArraysConverterFactory::operator()(), ChunkMetadata::operator==(), Parser::InsertIntoTableAsSelectStmt::populateData(), ResultSetReductionJIT::reduceOneSlot(), ResultSetStorage::reduceOneSlot(), FixedLengthArrayNoneEncoder::resetChunkStats(), ArrayNoneEncoder::resetChunkStats(), foreign_storage::ParquetFixedLengthArrayEncoder::setNullFixedLengthArraySentinel(), import_export::StringToArray(), import_export::TDatumToArrayDatum(), Analyzer::Constant::toString(), ThriftSerializers::type_info_to_thrift(), ExpressionRange::typeSupportsRange(), ddl_utils::validate_and_set_array_size(), DBHandler::value_to_thrift(), and DBHandler::value_to_thrift_column().

697  {
698  return SQLTypeInfo(
700  }
SQLTypes subtype
Definition: sqltypes.h:731
bool notnull
Definition: sqltypes.h:734
EncodingType compression
Definition: sqltypes.h:735
int comp_param
Definition: sqltypes.h:736
int dimension
Definition: sqltypes.h:732
+ Here is the caller graph for this function:

◆ get_input_srid()

HOST DEVICE int SQLTypeInfo::get_input_srid ( ) const
inline

Definition at line 315 of file sqltypes.h.

Referenced by Geospatial::GeoBase::transform(), RelAlgTranslator::translateBinaryGeoFunction(), RelAlgTranslator::translateGeoFunctionArg(), and RelAlgTranslator::translateUnaryGeoFunction().

315 { return dimension; }
int dimension
Definition: sqltypes.h:732
+ Here is the caller graph for this function:

◆ get_logical_size()

int SQLTypeInfo::get_logical_size ( ) const
inline

Definition at line 322 of file sqltypes.h.

References get_size(), kENCODING_DATE_IN_DAYS, kENCODING_DICT, kENCODING_FIXED, kENCODING_NONE, and run_benchmark_import::type.

Referenced by CodeGenerator::codegenCastBetweenIntTypes(), CodeGenerator::codegenCastBetweenIntTypesOverflowChecks(), CodeGenerator::codgenAdjustFixedEncNull(), Parser::InsertValuesStmt::determineLeafIndex(), get_agg_initial_val(), StorageIOFacility::getRsBufferNoPadding(), inline_int_null_val(), anonymous_namespace{TypedDataAccessors.h}::is_null(), is_unsigned_type(), anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_arguments(), numeric_type_name(), and Fragmenter_Namespace::sizeOfRawColumn().

322  {
325  return ti.get_size();
326  }
327  if (compression == kENCODING_DICT) {
328  return 4;
329  }
330  return get_size();
331  }
HOST DEVICE int get_size() const
Definition: sqltypes.h:321
SQLTypes subtype
Definition: sqltypes.h:731
bool notnull
Definition: sqltypes.h:734
EncodingType compression
Definition: sqltypes.h:735
SQLTypes type
Definition: sqltypes.h:730
int dimension
Definition: sqltypes.h:732
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_notnull()

HOST DEVICE bool SQLTypeInfo::get_notnull ( ) const
inline

Definition at line 318 of file sqltypes.h.

Referenced by import_export::TypedImportBuffer::add_arrow_values(), import_export::TypedImportBuffer::add_value(), import_export::TypedImportBuffer::add_values(), Catalog_Namespace::Catalog::addColumn(), Parser::InsertValuesStmt::analyze(), Analyzer::BinOper::analyze_type_info(), anonymous_namespace{ResultSetIteration.cpp}::GeoTargetValueBuilder< GEO_SOURCE_TYPE, GeoTargetFetcher >::build(), ChunkIter_get_nth(), ChunkIter_get_nth_point_coords(), CodeGenerator::codegen(), CodeGenerator::codegenCast(), CodeGenerator::codegenCastBetweenIntTypes(), CodeGenerator::codegenCastBetweenIntTypesOverflowChecks(), CodeGenerator::codegenCastFromFp(), CodeGenerator::codegenCastToFp(), CodeGenerator::codegenDateTruncHighPrecisionTimestamps(), CodeGenerator::codegenDiv(), CodeGenerator::codegenExtractHighPrecisionTimestamps(), Analyzer::BinOper::common_numeric_type(), Analyzer::BinOper::common_string_type(), Geospatial::compress_coords(), anonymous_namespace{ArrowResultSetConverter.cpp}::create_or_append_validity(), Catalog_Namespace::Catalog::createTable(), Analyzer::Expr::decompress(), Analyzer::InIntegerSet::deep_copy(), Analyzer::Constant::do_cast(), anonymous_namespace{ResultSetIteration.cpp}::GeoLazyFetchHandler::fetch(), anonymous_namespace{ResultSetIteration.cpp}::GeoQueryOutputFetchHandler::fetch(), get_agg_initial_val(), get_logical_type_info(), get_null_check_suffix(), get_target_info(), Analyzer::anonymous_namespace{Analyzer.cpp}::is_expr_nullable(), FixedLengthArrayNoneEncoder::is_null(), foreign_storage::csv_file_buffer_parser::is_null_datum(), Geospatial::is_null_point(), ResultSet::isNull(), ArrowResultSetConverter::makeField(), NullAwareValidator< INNER_VALIDATOR >::NullAwareValidator(), operator!=(), operator=(), operator==(), pair_to_double(), DBHandler::populateThriftColumnType(), anonymous_namespace{TypedDataAccessors.h}::put_null(), anonymous_namespace{TypedDataAccessors.h}::put_null_array(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), Executor::reduceResults(), GeoTargetValueSerializer< kPOINT >::serialize(), GeoWktSerializer< kPOINT >::serialize(), GeoTargetValuePtrSerializer< kPOINT >::serialize(), GeoTargetValueSerializer< kLINESTRING >::serialize(), GeoWktSerializer< kLINESTRING >::serialize(), GeoTargetValuePtrSerializer< kLINESTRING >::serialize(), GeoTargetValueSerializer< kPOLYGON >::serialize(), GeoWktSerializer< kPOLYGON >::serialize(), GeoTargetValuePtrSerializer< kPOLYGON >::serialize(), GeoTargetValueSerializer< kMULTIPOLYGON >::serialize(), GeoWktSerializer< kMULTIPOLYGON >::serialize(), GeoTargetValuePtrSerializer< kMULTIPOLYGON >::serialize(), Fragmenter_Namespace::set_chunk_stats(), anonymous_namespace{ResultSetReductionJIT.cpp}::target_info_key(), ThriftSerializers::type_info_to_thrift(), ddl_utils::validate_and_set_sparse_encoding(), foreign_storage::ParquetEncoder::validateNullCount(), DBHandler::value_to_thrift_column(), DeepCopyVisitor::visitInIntegerSet(), and File_Namespace::FileBuffer::writeMetadata().

318 { return notnull; }
bool notnull
Definition: sqltypes.h:734

◆ get_output_srid()

◆ get_physical_cols()

int SQLTypeInfo::get_physical_cols ( ) const
inline

Definition at line 332 of file sqltypes.h.

References kLINESTRING, kMULTIPOLYGON, kPOINT, kPOLYGON, and run_benchmark_import::type.

Referenced by Catalog_Namespace::Catalog::buildMaps(), Parser::DropColumnStmt::execute(), foreign_storage::ParquetDataWrapper::loadBuffersUsingLazyParquetChunkLoader(), and Catalog_Namespace::Catalog::renameColumn().

332  {
333  switch (type) {
334  case kPOINT:
335  return 1; // coords
336  case kLINESTRING:
337  return 2; // coords, bounds
338  case kPOLYGON:
339  return 4; // coords, ring_sizes, bounds, render_group
340  case kMULTIPOLYGON:
341  return 5; // coords, ring_sizes, poly_rings, bounds, render_group
342  default:
343  break;
344  }
345  return 0;
346  }
SQLTypes type
Definition: sqltypes.h:730
+ Here is the caller graph for this function:

◆ get_physical_coord_cols()

int SQLTypeInfo::get_physical_coord_cols ( ) const
inline

Definition at line 347 of file sqltypes.h.

References kLINESTRING, kMULTIPOLYGON, kPOINT, kPOLYGON, and run_benchmark_import::type.

Referenced by advance_target_ptr_col_wise(), advance_target_ptr_row_wise(), TargetExprCodegen::codegen(), CodeGenerator::codegenFunctionOperNullArg(), CodeGenerator::codegenGeoBinOper(), CodeGenerator::codegenGeoUOper(), get_slots_for_geo_target(), and RelAlgTranslator::translateGeoColumn().

347  {
348  // @TODO dmitri/simon rename this function?
349  // It needs to return the number of extra columns
350  // which need to go through the executor, as opposed
351  // to those which are only needed by CPU for poly
352  // cache building or what-not. For now, we just omit
353  // the Render Group column. If we add Bounding Box
354  // or something this may require rethinking. Perhaps
355  // these two functions need to return an array of
356  // offsets rather than just a number to loop over,
357  // so that executor and non-executor columns can
358  // be mixed.
359  // NOTE(adb): In binding to extension functions, we need to know some pretty specific
360  // type info about each of the physical coords cols for each geo type. I added checks
361  // there to ensure the physical coords col for the geo type match what we expect. If
362  // these values are ever changed, corresponding values in
363  // ExtensionFunctionsBinding.cpp::compute_narrowing_conv_scores and
364  // ExtensionFunctionsBinding.cpp::compute_widening_conv_scores will also need to be
365  // changed.
366  switch (type) {
367  case kPOINT:
368  return 1;
369  case kLINESTRING:
370  return 1; // omit bounds
371  case kPOLYGON:
372  return 2; // omit bounds, render group
373  case kMULTIPOLYGON:
374  return 3; // omit bounds, render group
375  default:
376  break;
377  }
378  return 0;
379  }
SQLTypes type
Definition: sqltypes.h:730
+ Here is the caller graph for this function:

◆ get_precision()

◆ get_scale()

HOST DEVICE int SQLTypeInfo::get_scale ( ) const
inline

Definition at line 316 of file sqltypes.h.

Referenced by Catalog_Namespace::Catalog::addColumn(), Analyzer::BinOper::analyze_type_info(), Analyzer::Constant::cast_number(), Executor::castToFP(), CodeGenerator::codegenCastBetweenIntTypes(), CodeGenerator::codegenCastToFp(), CodeGenerator::codegenCmpDecimalConst(), CodeGenerator::codegenDiv(), CodeGenerator::codgenAdjustFixedEncNull(), Analyzer::BinOper::common_numeric_type(), convert_decimal_value_to_scale(), Catalog_Namespace::Catalog::createTable(), DatumToString(), anonymous_namespace{TypedDataAccessors.h}::decimal_to_double(), Analyzer::anonymous_namespace{Analyzer.cpp}::decimal_to_int_frac(), DecimalOverflowValidator::DecimalOverflowValidator(), Analyzer::Expr::decompress(), anonymous_namespace{ArrowResultSetConverter.cpp}::get_arrow_type(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), get_logical_type_info(), getArrowImportType(), anonymous_namespace{RelAlgTranslator.cpp}::makeNumericConstant(), operator!=(), operator=(), operator==(), pair_to_double(), parse_numeric(), Parser::InsertIntoTableAsSelectStmt::populateData(), DBHandler::populateThriftColumnType(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), anonymous_namespace{ExpressionRange.cpp}::scale_up_interval_endpoint(), Analyzer::UOper::toString(), ThriftSerializers::type_info_to_thrift(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_decimal_mapping(), DBHandler::value_to_thrift(), DBHandler::value_to_thrift_column(), and File_Namespace::FileBuffer::writeMetadata().

316 { return scale; }
+ Here is the caller graph for this function:

◆ get_size()

HOST DEVICE int SQLTypeInfo::get_size ( ) const
inline

Definition at line 321 of file sqltypes.h.

Referenced by import_export::TypedImportBuffer::add_value(), Catalog_Namespace::Catalog::addColumn(), ArrayValueConverter< ELEMENT_CONVERTER >::ArrayValueConverter(), Chunk_NS::Chunk::begin_iterator(), anonymous_namespace{CastIR.cpp}::byte_array_cast(), CodeGenerator::castArrayPointer(), Executor::castToFP(), anonymous_namespace{QueryRewrite.cpp}::check_string_id_overflow(), CodeGenerator::codegenAdd(), CodeGenerator::codegenCast(), CodeGenerator::codegenMul(), CodeGenerator::codegenSub(), CodeGenerator::codgenAdjustFixedEncNull(), GroupByAndAggregate::convertNullIfAny(), NumericConverterFactory< SOURCE_TYPE, TARGET_TYPE >::create(), ResultSetLogicalValuesBuilder::create(), DictionaryConverterFactory< TARGET_TYPE >::create(), Encoder::Create(), ArrowForeignStorageBase::createDecimalColumn(), Catalog_Namespace::Catalog::createTable(), decimal_to_int_type(), Parser::InsertValuesStmt::determineLeafIndex(), RelAlgExecutor::executeSimpleInsert(), Fragmenter_Namespace::FixedLenArrayChunkConverter::FixedLenArrayChunkConverter(), ArrowForeignStorageBase::generateNullValues(), ArrowForeignStorageBase::generateSentinelValues(), get_bit_width(), anonymous_namespace{ArrowResultSetConverter.cpp}::get_dict_index_type(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), anonymous_namespace{TableFunctionCompilationContext.cpp}::get_llvm_type_from_sql_column_type(), get_logical_size(), anonymous_namespace{ArrowResultSetConverter.cpp}::get_physical_type(), anonymous_namespace{TypedDataAccessors.h}::get_scalar(), getArrowImportType(), Parser::LocalConnector::getColumnDescriptors(), foreign_storage::TimestampBoundsValidator< T >::getMinMaxBoundsAsStrings(), foreign_storage::IntegralFixedLengthBoundsValidator< T >::getMinMaxBoundsAsStrings(), foreign_storage::DateInSecondsBoundsValidator< T >::getMinMaxBoundsAsStrings(), foreign_storage::FloatPointValidator< T >::getMinMaxBoundsAsStrings(), Chunk_NS::Chunk::getNumElemsForBytesInsertData(), StorageIOFacility::getRsBufferNoPadding(), inline_fixed_encoding_null_val(), is_unsigned_type(), ColumnFetcher::makeJoinColumn(), import_export::NullArray(), CgenState::nullValueAsDouble(), TextConverterFactory::operator()(), operator=(), foreign_storage::ParquetFixedLengthArrayEncoder::ParquetFixedLengthArrayEncoder(), Parser::InsertIntoTableAsSelectStmt::populateData(), DBHandler::populateThriftColumnType(), anonymous_namespace{TypedDataAccessors.h}::put_null(), anonymous_namespace{TypedDataAccessors.h}::put_null_array(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::resize_values_buffer(), Fragmenter_Namespace::sizeOfRawColumn(), import_export::StringToArray(), import_export::TDatumToArrayDatum(), RelAlgTranslator::translateCardinality(), ThriftSerializers::type_info_to_thrift(), import_export::TypedImportBuffer::TypedImportBuffer(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumns(), ddl_utils::validate_and_set_array_size(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_integral_mapping(), foreign_storage::TimestampBoundsValidator< T >::valueWithinBounds(), foreign_storage::IntegralFixedLengthBoundsValidator< T >::valueWithinBounds(), foreign_storage::DateInSecondsBoundsValidator< T >::valueWithinBounds(), foreign_storage::FloatPointValidator< T >::valueWithinBounds(), and File_Namespace::FileBuffer::writeMetadata().

321 { return size; }

◆ get_storage_size()

HOST DEVICE int SQLTypeInfo::get_storage_size ( ) const
inlineprivate

Definition at line 742 of file sqltypes.h.

References convert_decimal_value_to_scale(), DatumEqual(), DatumToString(), decimal_to_int_type(), kARRAY, kBIGINT, kBOOLEAN, kCHAR, kCOLUMN, kDATE, kDECIMAL, kDOUBLE, kENCODING_DATE_IN_DAYS, kENCODING_DICT, kENCODING_DIFF, kENCODING_FIXED, kENCODING_NONE, kENCODING_RL, kENCODING_SPARSE, kFLOAT, kINT, kINTERVAL_DAY_TIME, kINTERVAL_YEAR_MONTH, kLINESTRING, kMULTIPOLYGON, kNUMERIC, kPOINT, kPOLYGON, kSMALLINT, kTEXT, kTIME, kTIMESTAMP, kTINYINT, kVARCHAR, and StringToDatum().

742  {
743  switch (type) {
744  case kBOOLEAN:
745  return sizeof(int8_t);
746  case kTINYINT:
747  return sizeof(int8_t);
748  case kSMALLINT:
749  switch (compression) {
750  case kENCODING_NONE:
751  return sizeof(int16_t);
752  case kENCODING_FIXED:
753  case kENCODING_SPARSE:
754  return comp_param / 8;
755  case kENCODING_RL:
756  case kENCODING_DIFF:
757  break;
758  default:
759  assert(false);
760  }
761  break;
762  case kINT:
763  switch (compression) {
764  case kENCODING_NONE:
765  return sizeof(int32_t);
766  case kENCODING_FIXED:
767  case kENCODING_SPARSE:
768  return comp_param / 8;
769  case kENCODING_RL:
770  case kENCODING_DIFF:
771  break;
772  default:
773  assert(false);
774  }
775  break;
776  case kBIGINT:
777  case kNUMERIC:
778  case kDECIMAL:
779  switch (compression) {
780  case kENCODING_NONE:
781  return sizeof(int64_t);
782  case kENCODING_FIXED:
783  case kENCODING_SPARSE:
784  return comp_param / 8;
785  case kENCODING_RL:
786  case kENCODING_DIFF:
787  break;
788  default:
789  assert(false);
790  }
791  break;
792  case kFLOAT:
793  switch (compression) {
794  case kENCODING_NONE:
795  return sizeof(float);
796  case kENCODING_FIXED:
797  case kENCODING_RL:
798  case kENCODING_DIFF:
799  case kENCODING_SPARSE:
800  assert(false);
801  break;
802  default:
803  assert(false);
804  }
805  break;
806  case kDOUBLE:
807  switch (compression) {
808  case kENCODING_NONE:
809  return sizeof(double);
810  case kENCODING_FIXED:
811  case kENCODING_RL:
812  case kENCODING_DIFF:
813  case kENCODING_SPARSE:
814  assert(false);
815  break;
816  default:
817  assert(false);
818  }
819  break;
820  case kTIMESTAMP:
821  case kTIME:
822  case kINTERVAL_DAY_TIME:
824  case kDATE:
825  switch (compression) {
826  case kENCODING_NONE:
827  return sizeof(int64_t);
828  case kENCODING_FIXED:
829  if (type == kTIMESTAMP && dimension > 0) {
830  assert(false); // disable compression for timestamp precisions
831  }
832  return comp_param / 8;
833  case kENCODING_RL:
834  case kENCODING_DIFF:
835  case kENCODING_SPARSE:
836  assert(false);
837  break;
839  switch (comp_param) {
840  case 0:
841  return 4; // Default date encoded in days is 32 bits
842  case 16:
843  case 32:
844  return comp_param / 8;
845  default:
846  assert(false);
847  break;
848  }
849  default:
850  assert(false);
851  }
852  break;
853  case kTEXT:
854  case kVARCHAR:
855  case kCHAR:
856  if (compression == kENCODING_DICT) {
857  return sizeof(int32_t); // @TODO(wei) must check DictDescriptor
858  }
859  break;
860  case kARRAY:
861  // TODO: return size for fixlen arrays?
862  break;
863  case kPOINT:
864  case kLINESTRING:
865  case kPOLYGON:
866  case kMULTIPOLYGON:
867  case kCOLUMN:
868  break;
869  default:
870  break;
871  }
872  return -1;
873  }
Definition: sqltypes.h:48
EncodingType compression
Definition: sqltypes.h:735
Definition: sqltypes.h:51
Definition: sqltypes.h:52
Definition: sqltypes.h:40
SQLTypes type
Definition: sqltypes.h:730
Definition: sqltypes.h:44
int comp_param
Definition: sqltypes.h:736
int dimension
Definition: sqltypes.h:732
+ Here is the call graph for this function:

◆ get_subtype()

HOST DEVICE SQLTypes SQLTypeInfo::get_subtype ( ) const
inline

Definition at line 312 of file sqltypes.h.

Referenced by import_export::TypedImportBuffer::add_value(), import_export::TypedImportBuffer::add_values(), Catalog_Namespace::Catalog::addColumn(), Parser::ArrayLiteral::analyze(), Parser::InsertValuesStmt::analyze(), anonymous_namespace{CastIR.cpp}::byte_array_cast(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codgenAdjustFixedEncNull(), Encoder::Create(), Catalog_Namespace::Catalog::createTable(), Analyzer::Expr::decompress(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), get_logical_type_info(), import_export::Loader::getStringDict(), import_export::anonymous_namespace{QueryExporterGDAL.cpp}::insert_array_column(), FixedLengthArrayNoneEncoder::is_null(), operator!=(), operator=(), operator==(), Parser::InsertIntoTableAsSelectStmt::populateData(), DBHandler::populateThriftColumnType(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), import_export::anonymous_namespace{QueryExporterGDAL.cpp}::sql_type_info_to_ogr_field_type(), RelAlgTranslator::translateArrayFunction(), RelAlgTranslator::translateBinaryGeoFunction(), RelAlgTranslator::translateUnaryGeoFunction(), ThriftSerializers::type_info_to_thrift(), type_to_thrift(), import_export::TypedImportBuffer::TypedImportBuffer(), FixedLengthArrayNoneEncoder::update_elem_stats(), ArrayNoneEncoder::update_elem_stats(), ddl_utils::validate_and_set_fixed_encoding(), and File_Namespace::FileBuffer::writeMetadata().

312 { return subtype; }
SQLTypes subtype
Definition: sqltypes.h:731
+ Here is the caller graph for this function:

◆ get_type()

HOST DEVICE SQLTypes SQLTypeInfo::get_type ( ) const
inline

Definition at line 311 of file sqltypes.h.

References run_benchmark_import::type.

Referenced by import_export::TypedImportBuffer::add_arrow_values(), import_export::TypedImportBuffer::add_value(), import_export::TypedImportBuffer::add_values(), Catalog_Namespace::Catalog::addColumn(), Parser::ArrayLiteral::analyze(), Parser::FunctionRef::analyze(), Parser::InsertValuesStmt::analyze(), Analyzer::BinOper::analyze_type_info(), appendDatum(), Analyzer::Constant::cast_number(), Analyzer::Constant::cast_string(), Analyzer::Constant::cast_to_string(), CodeGenerator::castArrayPointer(), TargetExprCodegen::codegenAggregate(), CodeGenerator::codegenCast(), CodeGenerator::codegenCastFromFp(), CodeGenerator::codegenCastToFp(), CodeGenerator::codegenCmp(), CodeGenerator::codegenDiv(), CodeGenerator::codegenFunctionOper(), CodeGenerator::codegenGeoBinOper(), CodeGenerator::codegenGeoUOper(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codegenIsNullNumber(), Analyzer::BinOper::common_numeric_type(), Analyzer::BinOper::common_string_type(), Geospatial::compress_coords(), import_export::TypedImportBuffer::convert_arrow_val_to_import_buffer(), TargetValueConverterFactory::create(), Encoder::Create(), Catalog_Namespace::Catalog::createTable(), Analyzer::Datum_equal(), DatumEqual(), DatumToString(), decompress(), Analyzer::Expr::decompress(), Analyzer::Constant::deep_copy(), Analyzer::Constant::do_cast(), RelAlgExecutor::executeSimpleInsert(), Parser::anonymous_namespace{ParserNode.cpp}::expr_is_null(), extract_from_datum(), anonymous_namespace{ExpressionRange.cpp}::extract_max_stat_double(), anonymous_namespace{ExpressionRange.cpp}::extract_min_stat_double(), anonymous_namespace{ResultSetIteration.cpp}::GeoLazyFetchHandler::fetch(), anonymous_namespace{ResultSetIteration.cpp}::GeoQueryOutputFetchHandler::fetch(), ChunkMetadata::fillChunkStats(), anonymous_namespace{WindowContext.cpp}::fp_comparator(), anonymous_namespace{ExpressionRange.cpp}::fpRangeFromDecimal(), ArrowForeignStorageBase::generateNullValues(), ArrowForeignStorageBase::generateSentinelValues(), get_bit_width(), anonymous_namespace{PerfectJoinHashTable.cpp}::get_bucketized_hash_entry_info(), anonymous_namespace{ArrowResultSetConverter.cpp}::get_dict_index_type(), ExtensionFunctionsWhitelist::get_ext_funcs(), get_logical_type_info(), anonymous_namespace{ArrowResultSetConverter.cpp}::get_physical_type(), anonymous_namespace{TypedDataAccessors.h}::get_scalar(), anonymous_namespace{WindowFunctionIR.cpp}::get_window_agg_name(), getArrowImportType(), Chunk_NS::Chunk::getChunkBuffer(), EmbeddedDatabase::CursorImpl::getColType(), getExpressionRange(), Geospatial::GeoTypesFactory::getGeoColumns(), PerfectJoinHashTable::getHashJoinArgs(), Geospatial::GeoTypesFactory::getNullGeoColumns(), Executor::getNumBytesForFetchedRow(), Chunk_NS::Chunk::getNumElemsForBytesInsertData(), StorageIOFacility::getRsBufferNoPadding(), import_export::Loader::getStringDict(), Analyzer::ColumnVar::group_predicates(), Chunk_NS::Chunk::initEncoder(), inline_fp_null_val(), inline_int_null_val(), anonymous_namespace{Execute.cpp}::inline_null_val(), CgenState::inlineFpNull(), CgenState::inlineIntNull(), import_export::anonymous_namespace{QueryExporterGDAL.cpp}::insert_geo_column(), import_export::anonymous_namespace{QueryExporterGDAL.cpp}::insert_scalar_column(), is_castable(), Geospatial::is_null_point(), Analyzer::anonymous_namespace{Analyzer.cpp}::is_null_value(), anonymous_namespace{ScalarCodeGenerator.cpp}::llvm_type_from_sql(), make_fp_constant(), ResultSet::makeGeoTargetValue(), anonymous_namespace{RelAlgTranslator.cpp}::makeNumericConstant(), ResultSet::makeVarlenTargetValue(), anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_arguments(), anonymous_namespace{WindowExpressionRewrite.cpp}::matches_gt_bigint_zero(), need_patch_unnest_double(), Parser::CaseExpr::normalize(), null_val_bit_pattern(), import_export::NullArrayDatum(), import_export::NullDatum(), numeric_type_name(), operator!=(), operator=(), operator==(), pair_to_double(), foreign_storage::ParquetGeospatialEncoder::ParquetGeospatialEncoder(), populate_TColumn(), Parser::InsertIntoTableAsSelectStmt::populateData(), DBHandler::populateThriftColumnType(), foreign_storage::ParquetGeospatialEncoder::processGeoElement(), foreign_storage::ParquetGeospatialEncoder::processNullGeoElement(), anonymous_namespace{TypedDataAccessors.h}::put_null(), anonymous_namespace{TypedDataAccessors.h}::put_null_array(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), ArrowForeignStorageBase::read(), ddl_utils::set_default_encoding(), import_export::Importer::set_geo_physical_import_buffer(), import_export::Importer::set_geo_physical_import_buffer_columnar(), anonymous_namespace{TableOptimizer.cpp}::set_metadata_from_results(), Analyzer::Constant::set_null_value(), Fragmenter_Namespace::sizeOfRawColumn(), import_export::anonymous_namespace{QueryExporterGDAL.cpp}::sql_type_info_to_ogr_field_type(), StringToDatum(), takes_float_argument(), import_export::TDatumToDatum(), Analyzer::Constant::toString(), RelAlgTranslator::translateBinaryGeoFunction(), RelAlgTranslator::translateGeoBinaryConstructor(), RelAlgTranslator::translateGeoColumn(), RelAlgTranslator::translateGeoFunctionArg(), RelAlgTranslator::translateGeoLiteral(), RelAlgTranslator::translateGeoOverlapsOper(), RelAlgTranslator::translateUnaryGeoFunction(), ArrowForeignStorageBase::tryZeroCopy(), ThriftSerializers::type_info_to_thrift(), type_to_thrift(), import_export::TypedImportBuffer::TypedImportBuffer(), ddl_utils::validate_and_set_date_encoding(), ddl_utils::validate_and_set_fixed_encoding(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_date_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_floating_point_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_none_type_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_time_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_timestamp_mapping(), foreign_storage::ParquetGeospatialEncoder::validateChunksAndMetadataSizing(), DBHandler::value_to_thrift(), DBHandler::value_to_thrift_column(), anonymous_namespace{WindowExpressionRewrite.cpp}::window_sum_and_count_match(), and File_Namespace::FileBuffer::writeMetadata().

311 { return type; }
SQLTypes type
Definition: sqltypes.h:730

◆ get_type_name()

std::string SQLTypeInfo::get_type_name ( ) const
inline

Definition at line 414 of file sqltypes.h.

References CHECK_LT, IS_GEO, kARRAY, kCOLUMN, kDECIMAL, kNUMERIC, kSQLTYPE_LAST, kTIMESTAMP, to_string(), run_benchmark_import::type, and type_name().

Referenced by Analyzer::Expr::add_cast(), Analyzer::BinOper::analyze_type_info(), CodeGenerator::codegenCastFromFp(), CodeGenerator::codegenCastFromString(), CodeGenerator::codegenCastToFp(), Analyzer::BinOper::common_numeric_type(), TargetValueConverterFactory::create(), anonymous_namespace{ExternalExecutor.cpp}::create_table_schema(), anonymous_namespace{ArrowImporter.h}::data_conversion_error(), Analyzer::Datum_equal(), DatumToString(), Analyzer::Constant::do_cast(), ChunkMetadata::dump(), get_agg_type(), anonymous_namespace{ArrowResultSetConverter.cpp}::get_arrow_type(), getArrowImportType(), Data_Namespace::AbstractBuffer::initEncoder(), import_export::anonymous_namespace{QueryExporterGDAL.cpp}::insert_array_column(), ResultSet::makeGeoTargetValue(), anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_arguments(), pair_to_double(), Parser::InsertIntoTableAsSelectStmt::populateData(), Fragmenter_Namespace::sizeOfRawColumn(), import_export::anonymous_namespace{QueryExporterGDAL.cpp}::sql_type_info_to_ogr_field_type(), StringToDatum(), anonymous_namespace{ResultSetReductionJIT.cpp}::target_info_key(), Analyzer::ColumnVar::toString(), Analyzer::UOper::toString(), anonymous_namespace{ArrowImporter.h}::type_conversion_error(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_allowed_mapping(), and ScalarExprToSql::visitUOper().

414  {
415  if (IS_GEO(type)) {
416  std::string srid_string = "";
417  if (get_output_srid() > 0) {
418  srid_string = ", " + std::to_string(get_output_srid());
419  }
420  CHECK_LT(static_cast<int>(subtype), kSQLTYPE_LAST);
421  return type_name[static_cast<int>(subtype)] + "(" +
422  type_name[static_cast<int>(type)] + srid_string + ")";
423  }
424  std::string ps = "";
425  if (type == kDECIMAL || type == kNUMERIC) {
426  ps = "(" + std::to_string(dimension) + "," + std::to_string(scale) + ")";
427  } else if (type == kTIMESTAMP) {
428  ps = "(" + std::to_string(dimension) + ")";
429  }
430  if (type == kARRAY) {
431  auto elem_ti = get_elem_type();
432  auto num_elems = (size > 0) ? std::to_string(size / elem_ti.get_size()) : "";
433  CHECK_LT(static_cast<int>(subtype), kSQLTYPE_LAST);
434  return elem_ti.get_type_name() + ps + "[" + num_elems + "]";
435  }
436  if (type == kCOLUMN) {
437  auto elem_ti = get_elem_type();
438  auto num_elems =
439  (size > 0) ? "[" + std::to_string(size / elem_ti.get_size()) + "]" : "";
440  CHECK_LT(static_cast<int>(subtype), kSQLTYPE_LAST);
441  return "COLUMN<" + type_name[static_cast<int>(subtype)] + ps + ">" + num_elems;
442  }
443  return type_name[static_cast<int>(type)] + ps;
444  }
std::string to_string(char const *&&v)
HOST DEVICE int get_output_srid() const
Definition: sqltypes.h:317
static std::string type_name[kSQLTYPE_LAST]
Definition: sqltypes.h:739
SQLTypes subtype
Definition: sqltypes.h:731
#define CHECK_LT(x, y)
Definition: Logger.h:207
SQLTypeInfo get_elem_type() const
Definition: sqltypes.h:697
SQLTypes type
Definition: sqltypes.h:730
size_t num_elems
#define IS_GEO(T)
Definition: sqltypes.h:242
int dimension
Definition: sqltypes.h:732
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ has_bounds()

bool SQLTypeInfo::has_bounds ( ) const
inline

Definition at line 380 of file sqltypes.h.

References kLINESTRING, kMULTIPOLYGON, kPOLYGON, and run_benchmark_import::type.

Referenced by RelAlgTranslator::translateGeoColumn(), and RelAlgTranslator::translateGeoLiteral().

380  {
381  switch (type) {
382  case kLINESTRING:
383  case kPOLYGON:
384  case kMULTIPOLYGON:
385  return true;
386  default:
387  break;
388  }
389  return false;
390  }
SQLTypes type
Definition: sqltypes.h:730
+ Here is the caller graph for this function:

◆ has_render_group()

bool SQLTypeInfo::has_render_group ( ) const
inline

Definition at line 391 of file sqltypes.h.

References kMULTIPOLYGON, kPOLYGON, and run_benchmark_import::type.

Referenced by RelAlgTranslator::translateGeoColumn().

391  {
392  switch (type) {
393  case kPOLYGON:
394  case kMULTIPOLYGON:
395  return true;
396  default:
397  break;
398  }
399  return false;
400  }
SQLTypes type
Definition: sqltypes.h:730
+ Here is the caller graph for this function:

◆ is_array()

bool SQLTypeInfo::is_array ( ) const
inline

Definition at line 486 of file sqltypes.h.

References kARRAY, and run_benchmark_import::type.

Referenced by anonymous_namespace{ResultSetIteration.cpp}::build_array_target_value(), anonymous_namespace{CastIR.cpp}::byte_array_cast(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codegenHoistedConstantsPlaceholders(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::create_parquet_array_encoder(), foreign_storage::ParquetEncoder::createMetadata(), Catalog_Namespace::Catalog::createTable(), DateDaysOverflowValidator::DateDaysOverflowValidator(), datum_to_string(), DecimalOverflowValidator::DecimalOverflowValidator(), Analyzer::Constant::do_cast(), ChunkMetadata::dump(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), foreign_storage::get_var_length_data_block_size(), Parser::LocalConnector::getColumnDescriptors(), getLeafColumnRange(), foreign_storage::TypedParquetInPlaceEncoder< int64_t, int32_t >::getRowGroupMetadata(), ResultSet::getTargetValueFromBufferRowwise(), foreign_storage::TypedParquetInPlaceEncoder< int64_t, int32_t >::getUpdatedStats(), CodeGenerator::hashJoinLhs(), is_real_str_or_array(), Fragmenter_Namespace::isDatumVectorData(), foreign_storage::ParquetDataWrapper::loadBuffersUsingLazyParquetChunkLoader(), ResultSet::makeVarlenTargetValue(), anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_arguments(), null_val_bit_pattern(), NullAwareValidator< INNER_VALIDATOR >::NullAwareValidator(), ChunkMetadata::operator==(), Analyzer::Constant::operator==(), Parser::InsertIntoTableAsSelectStmt::populateData(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), Catalog_Namespace::Catalog::setColumnDictionary(), anonymous_namespace{LogicalIR.cpp}::should_defer_eval(), Analyzer::Constant::toString(), ThriftSerializers::type_info_to_thrift(), ExpressionRange::typeSupportsRange(), foreign_storage::update_stats(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_array_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_max_repetition_and_definition_level(), DBHandler::value_to_thrift(), and DBHandler::value_to_thrift_column().

486 { return type == kARRAY; } // rbc Array
SQLTypes type
Definition: sqltypes.h:730
+ Here is the caller graph for this function:

◆ is_boolean()

◆ is_buffer()

bool SQLTypeInfo::is_buffer ( ) const
inline

Definition at line 495 of file sqltypes.h.

Referenced by anonymous_namespace{ExtensionsIR.cpp}::get_llvm_type_from_sql_array_type().

495 { return is_array() || is_column() || is_bytes(); }
bool is_array() const
Definition: sqltypes.h:486
bool is_bytes() const
Definition: sqltypes.h:492
bool is_column() const
Definition: sqltypes.h:491
+ Here is the caller graph for this function:

◆ is_bytes()

bool SQLTypeInfo::is_bytes ( ) const
inline

Definition at line 492 of file sqltypes.h.

References kENCODING_NONE, kTEXT, and run_benchmark_import::type.

Referenced by anonymous_namespace{ExtensionsIR.cpp}::get_llvm_type_from_sql_array_type().

492  {
493  return type == kTEXT && get_compression() == kENCODING_NONE;
494  } // rbc Bytes
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:319
Definition: sqltypes.h:51
SQLTypes type
Definition: sqltypes.h:730
+ Here is the caller graph for this function:

◆ is_castable()

bool SQLTypeInfo::is_castable ( const SQLTypeInfo new_type_info) const
inline

Definition at line 560 of file sqltypes.h.

References get_elem_type(), get_type(), is_number(), is_string(), kARRAY, kBOOLEAN, kCOLUMN, kDATE, kTIMESTAMP, and run_benchmark_import::type.

Referenced by Analyzer::Expr::add_cast().

560  {
561  // can always cast between the same type but different precision/scale/encodings
562  if (type == new_type_info.get_type()) {
563  return true;
564  // can always cast from or to string
565  } else if (is_string() || new_type_info.is_string()) {
566  return true;
567  // can cast between numbers
568  } else if (is_number() && new_type_info.is_number()) {
569  return true;
570  // can cast from timestamp or date to number (epoch)
571  } else if ((type == kTIMESTAMP || type == kDATE) && new_type_info.is_number()) {
572  return true;
573  // can cast from date to timestamp
574  } else if (type == kDATE && new_type_info.get_type() == kTIMESTAMP) {
575  return true;
576  } else if (type == kTIMESTAMP && new_type_info.get_type() == kDATE) {
577  return true;
578  } else if (type == kBOOLEAN && new_type_info.is_number()) {
579  return true;
580  } else if (type == kARRAY && new_type_info.get_type() == kARRAY) {
581  return get_elem_type().is_castable(new_type_info.get_elem_type());
582  } else if (type == kCOLUMN && new_type_info.get_type() == kCOLUMN) {
583  return get_elem_type().is_castable(new_type_info.get_elem_type());
584  } else {
585  return false;
586  }
587  }
bool is_string() const
Definition: sqltypes.h:478
bool is_castable(const SQLTypeInfo &new_type_info) const
Definition: sqltypes.h:560
Definition: sqltypes.h:52
SQLTypeInfo get_elem_type() const
Definition: sqltypes.h:697
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:311
SQLTypes type
Definition: sqltypes.h:730
bool is_number() const
Definition: sqltypes.h:483
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_column()

bool SQLTypeInfo::is_column ( ) const
inline

Definition at line 491 of file sqltypes.h.

References kCOLUMN, and run_benchmark_import::type.

Referenced by DBHandler::value_to_thrift_column().

491 { return type == kCOLUMN; } // rbc Column
SQLTypes type
Definition: sqltypes.h:730
+ Here is the caller graph for this function:

◆ is_date()

◆ is_date_in_days()

bool SQLTypeInfo::is_date_in_days ( ) const
inline

Definition at line 705 of file sqltypes.h.

References kDATE, kENCODING_DATE_IN_DAYS, and run_benchmark_import::type.

Referenced by DateDaysEncoder< T, V >::appendData(), DateDaysOverflowValidator::DateDaysOverflowValidator(), get_join_column_type_kind(), Parser::LocalConnector::getColumnDescriptors(), ResultSet::makeTargetValue(), and DBHandler::populateThriftColumnType().

705  {
706  if (type == kDATE) {
707  const auto comp_type = get_compression();
708  if (comp_type == kENCODING_DATE_IN_DAYS) {
709  return true;
710  }
711  }
712  return false;
713  }
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:319
Definition: sqltypes.h:52
SQLTypes type
Definition: sqltypes.h:730
+ Here is the caller graph for this function:

◆ is_decimal()

bool SQLTypeInfo::is_decimal ( ) const
inline

Definition at line 481 of file sqltypes.h.

References kDECIMAL, kNUMERIC, and run_benchmark_import::type.

Referenced by Analyzer::Constant::add_cast(), import_export::TypedImportBuffer::add_value(), Analyzer::BinOper::analyze_type_info(), anonymous_namespace{RelAlgTranslator.cpp}::build_type_info(), CodeGenerator::checkExpressionRanges(), CodeGenerator::codegenAdd(), CodeGenerator::codegenCast(), CodeGenerator::codegenCastBetweenIntTypes(), CodeGenerator::codegenCastFromFp(), CodeGenerator::codegenCmp(), CodeGenerator::codegenDiv(), CodeGenerator::codegenFunctionOperWithCustomTypeHandling(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codegenMul(), CodeGenerator::codegenSub(), datum_to_string(), DecimalOverflowValidator::DecimalOverflowValidator(), extract_from_datum(), get_bit_width(), inline_fixed_encoding_null_val(), import_export::NullArrayDatum(), import_export::NullDatum(), numeric_type_name(), pair_to_double(), Parser::InsertIntoTableAsSelectStmt::populateData(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), Executor::reduceResults(), ddl_utils::set_default_encoding(), import_export::TDatumToDatum(), RelAlgTranslator::translateFunction(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumnMetadata(), anonymous_namespace{InputMetadata.cpp}::uses_int_meta(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_decimal_mapping(), DBHandler::value_to_thrift(), DBHandler::value_to_thrift_column(), and anonymous_namespace{ExpressionRewrite.cpp}::ConstantFoldingVisitor::visitBinOper().

481 { return type == kDECIMAL || type == kNUMERIC; }
SQLTypes type
Definition: sqltypes.h:730
+ Here is the caller graph for this function:

◆ is_dict_encoded_string()

◆ is_dict_encoded_type()

bool SQLTypeInfo::is_dict_encoded_type ( ) const
inline

Definition at line 516 of file sqltypes.h.

Referenced by anonymous_namespace{RelAlgExecutor.cpp}::is_metadata_placeholder(), and foreign_storage::anonymous_namespace{CsvDataWrapper.cpp}::skip_metadata_scan().

516  {
517  return is_dict_encoded_string() ||
519  }
bool is_array() const
Definition: sqltypes.h:486
bool is_dict_encoded_string() const
Definition: sqltypes.h:512
SQLTypeInfo get_elem_type() const
Definition: sqltypes.h:697
+ Here is the caller graph for this function:

◆ is_fixlen_array()

bool SQLTypeInfo::is_fixlen_array ( ) const
inline

Definition at line 488 of file sqltypes.h.

References kARRAY, and run_benchmark_import::type.

Referenced by foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::create_parquet_array_encoder(), Chunk_NS::Chunk::createChunkBuffer(), Chunk_NS::Chunk::getChunkBuffer(), Chunk_NS::Chunk::initEncoder(), and Chunk_NS::Chunk::isChunkOnDevice().

488 { return type == kARRAY && size > 0; }
SQLTypes type
Definition: sqltypes.h:730
+ Here is the caller graph for this function:

◆ is_fp()

bool SQLTypeInfo::is_fp ( ) const
inline

Definition at line 482 of file sqltypes.h.

References kDOUBLE, kFLOAT, and run_benchmark_import::type.

Referenced by Analyzer::Constant::add_cast(), Executor::castToFP(), CodeGenerator::codegenCastFromFp(), CodeGenerator::codegenCastToFp(), CodeGenerator::codegenDiv(), CodeGenerator::codegenFixedLengthColVarInWindow(), CodeGenerator::codegenIsNullNumber(), GroupByAndAggregate::convertNullIfAny(), anonymous_namespace{ArrowResultSetConverter.cpp}::create_or_append_validity(), anonymous_namespace{ExpressionRange.cpp}::fpRangeFromDecimal(), get_agg_initial_val(), anonymous_namespace{TableFunctionCompilationContext.cpp}::get_llvm_type_from_sql_column_type(), foreign_storage::FloatPointValidator< T >::getMinMaxBoundsAsStrings(), StorageIOFacility::getRsBufferNoPadding(), inline_fp_null_val(), anonymous_namespace{Execute.cpp}::inline_null_val(), CgenState::inlineFpNull(), is_supported_type_for_extern_execution(), need_patch_unnest_double(), null_val_bit_pattern(), CodeGenerator::NullCheckCodegen::NullCheckCodegen(), CgenState::nullValueAsDouble(), numeric_type_name(), Executor::reduceResults(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_floating_point_mapping(), foreign_storage::ParquetFixedLengthEncoder< V, T >::validateIntegralOrFloatingPointValue(), and foreign_storage::FloatPointValidator< T >::valueWithinBounds().

482 { return type == kFLOAT || type == kDOUBLE; }
SQLTypes type
Definition: sqltypes.h:730
+ Here is the caller graph for this function:

◆ is_geometry()

bool SQLTypeInfo::is_geometry ( ) const
inline

Definition at line 490 of file sqltypes.h.

References IS_GEO, and run_benchmark_import::type.

Referenced by advance_slot(), advance_target_ptr_col_wise(), advance_target_ptr_row_wise(), Parser::InsertStmt::analyze(), Parser::InsertValuesStmt::analyze(), Catalog_Namespace::Catalog::buildMaps(), TargetExprCodegen::codegen(), GroupByAndAggregate::codegenAggArg(), CodeGenerator::codegenCmp(), CodeGenerator::codegenColVar(), Analyzer::Constant::deep_copy(), Analyzer::Constant::do_cast(), Parser::AddColumnStmt::execute(), foreign_storage::get_var_length_data_block_size(), ResultSet::getTargetValueFromBufferColwise(), ResultSet::getTargetValueFromBufferRowwise(), import_export::anonymous_namespace{QueryExporterGDAL.cpp}::insert_array_column(), import_export::anonymous_namespace{QueryExporterGDAL.cpp}::insert_geo_column(), import_export::anonymous_namespace{QueryExporterGDAL.cpp}::insert_scalar_column(), isGeometry(), Fragmenter_Namespace::isStringVectorData(), foreign_storage::ParquetDataWrapper::loadBuffersUsingLazyParquetChunkLoader(), ResultSet::makeGeoTargetValue(), Parser::OperExpr::normalize(), null_val_bit_pattern(), foreign_storage::ParquetGeospatialEncoder::ParquetGeospatialEncoder(), Parser::InsertIntoTableAsSelectStmt::populateData(), ResultSetReductionJIT::reduceOneSlot(), ResultSetStorage::reduceOneSlot(), ddl_utils::set_default_encoding(), anonymous_namespace{TargetExprBuilder.cpp}::target_has_geo(), ddl_utils::validate_and_set_compressed_encoding(), ddl_utils::validate_and_set_none_encoding(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_geospatial_mapping(), DBHandler::value_to_thrift_column(), and Analyzer::Constant::~Constant().

490 { return IS_GEO(type); }
SQLTypes type
Definition: sqltypes.h:730
#define IS_GEO(T)
Definition: sqltypes.h:242
+ Here is the caller graph for this function:

◆ is_high_precision_timestamp()

bool SQLTypeInfo::is_high_precision_timestamp ( ) const
inline

Definition at line 717 of file sqltypes.h.

References kTIMESTAMP, and run_benchmark_import::type.

Referenced by CodeGenerator::codegenDateTruncHighPrecisionTimestamps(), CodeGenerator::codegenExtractHighPrecisionTimestamps(), Analyzer::Constant::do_cast(), anonymous_namespace{ExpressionRange.cpp}::getDateTimePrecisionCastRange(), DateTimeTranslator::getDateTruncConstantValue(), DateTimeTranslator::getExtractFromTimeConstantValue(), and ddl_utils::validate_and_set_fixed_encoding().

717  {
718  if (type == kTIMESTAMP) {
719  const auto dimension = get_dimension();
720  if (dimension > 0) {
721  return true;
722  }
723  }
724  return false;
725  }
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:313
SQLTypes type
Definition: sqltypes.h:730
int dimension
Definition: sqltypes.h:732
+ Here is the caller graph for this function:

◆ is_integer()

bool SQLTypeInfo::is_integer ( ) const
inline

Definition at line 480 of file sqltypes.h.

References IS_INTEGER, and run_benchmark_import::type.

Referenced by Analyzer::Constant::add_cast(), Parser::FunctionRef::analyze(), Analyzer::BinOper::analyze_type_info(), CodeGenerator::castArrayPointer(), CodeGenerator::codegenAdd(), CodeGenerator::codegenCast(), CodeGenerator::codegenCastBetweenIntTypes(), CodeGenerator::codegenCastFromFp(), CodeGenerator::codegenCmp(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codegenMod(), CodeGenerator::codegenMul(), CodeGenerator::codegenSub(), Analyzer::BinOper::common_numeric_type(), NumericConverterFactory< SOURCE_TYPE, TARGET_TYPE >::create(), anonymous_namespace{ArrowResultSetConverter.cpp}::create_or_append_validity(), ArrowForeignStorageBase::generateNullValues(), ArrowForeignStorageBase::generateSentinelValues(), get_agg_type(), anonymous_namespace{TableFunctionCompilationContext.cpp}::get_llvm_type_from_sql_column_type(), foreign_storage::IntegralFixedLengthBoundsValidator< T >::getMinMaxBoundsAsStrings(), inline_fixed_encoding_null_val(), anonymous_namespace{QueryMemoryDescriptor.cpp}::is_int_and_no_bigger_than(), Fragmenter_Namespace::is_integral(), is_supported_type_for_extern_execution(), numeric_type_name(), pair_to_double(), Parser::InsertIntoTableAsSelectStmt::populateData(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), Executor::reduceResults(), anonymous_namespace{InputMetadata.cpp}::uses_int_meta(), foreign_storage::ParquetUnsignedFixedLengthEncoder< V, T, U >::validate(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_integral_mapping(), foreign_storage::ParquetFixedLengthEncoder< V, T >::validateIntegralOrFloatingPointValue(), and foreign_storage::IntegralFixedLengthBoundsValidator< T >::valueWithinBounds().

480 { return IS_INTEGER(type); }
#define IS_INTEGER(T)
Definition: sqltypes.h:236
SQLTypes type
Definition: sqltypes.h:730
+ Here is the caller graph for this function:

◆ is_null() [1/2]

HOST DEVICE bool SQLTypeInfo::is_null ( const Datum d) const
inline

Definition at line 589 of file sqltypes.h.

References Datum::arrayval, Datum::bigintval, Datum::boolval, Datum::doubleval, Datum::floatval, Datum::intval, VarlenDatum::is_null, kARRAY, kBIGINT, kBOOLEAN, kCHAR, kDATE, kDECIMAL, kDOUBLE, kFLOAT, kINT, kNULLT, kNUMERIC, kSMALLINT, kTEXT, kTIME, kTIMESTAMP, kTINYINT, kVARCHAR, NULL_BIGINT, NULL_BOOLEAN, NULL_DOUBLE, NULL_FLOAT, NULL_INT, NULL_SMALLINT, NULL_TINYINT, Datum::smallintval, Datum::tinyintval, and run_benchmark_import::type.

Referenced by ChunkIter_get_next(), ChunkIter_get_nth(), and decompress().

589  {
590  // assuming Datum is always uncompressed
591  switch (type) {
592  case kBOOLEAN:
593  return (int8_t)d.boolval == NULL_BOOLEAN;
594  case kTINYINT:
595  return d.tinyintval == NULL_TINYINT;
596  case kSMALLINT:
597  return d.smallintval == NULL_SMALLINT;
598  case kINT:
599  return d.intval == NULL_INT;
600  case kBIGINT:
601  case kNUMERIC:
602  case kDECIMAL:
603  return d.bigintval == NULL_BIGINT;
604  case kFLOAT:
605  return d.floatval == NULL_FLOAT;
606  case kDOUBLE:
607  return d.doubleval == NULL_DOUBLE;
608  case kTIME:
609  case kTIMESTAMP:
610  case kDATE:
611  return d.bigintval == NULL_BIGINT;
612  case kTEXT:
613  case kVARCHAR:
614  case kCHAR:
615  // @TODO handle null strings
616  break;
617  case kNULLT:
618  return true;
619  case kARRAY:
620  return d.arrayval == NULL || d.arrayval->is_null;
621  default:
622  break;
623  }
624  return false;
625  }
int8_t tinyintval
Definition: sqltypes.h:203
#define NULL_DOUBLE
Definition: sqltypes.h:48
#define NULL_FLOAT
bool is_null
Definition: sqltypes.h:144
#define NULL_BIGINT
bool boolval
Definition: sqltypes.h:202
VarlenDatum * arrayval
Definition: sqltypes.h:209
int32_t intval
Definition: sqltypes.h:205
#define NULL_INT
float floatval
Definition: sqltypes.h:207
int64_t bigintval
Definition: sqltypes.h:206
int16_t smallintval
Definition: sqltypes.h:204
#define NULL_BOOLEAN
Definition: sqltypes.h:51
Definition: sqltypes.h:52
Definition: sqltypes.h:40
#define NULL_TINYINT
SQLTypes type
Definition: sqltypes.h:730
#define NULL_SMALLINT
Definition: sqltypes.h:44
double doubleval
Definition: sqltypes.h:208
+ Here is the caller graph for this function:

◆ is_null() [2/2]

HOST DEVICE bool SQLTypeInfo::is_null ( const int8_t *  val) const
inline

Definition at line 626 of file sqltypes.h.

References kDOUBLE, kFLOAT, kNULLT, NULL_BIGINT, NULL_DOUBLE, NULL_FLOAT, NULL_INT, NULL_SMALLINT, NULL_TINYINT, and run_benchmark_import::type.

626  {
627  if (type == kFLOAT) {
628  return *(float*)val == NULL_FLOAT;
629  }
630  if (type == kDOUBLE) {
631  return *(double*)val == NULL_DOUBLE;
632  }
633  // val can be either compressed or uncompressed
634  switch (size) {
635  case 1:
636  return *val == NULL_TINYINT;
637  case 2:
638  return *(int16_t*)val == NULL_SMALLINT;
639  case 4:
640  return *(int32_t*)val == NULL_INT;
641  case 8:
642  return *(int64_t*)val == NULL_BIGINT;
643  case kNULLT:
644  return true;
645  default:
646  // @TODO(wei) handle null strings
647  break;
648  }
649  return false;
650  }
#define NULL_DOUBLE
#define NULL_FLOAT
#define NULL_BIGINT
#define NULL_INT
#define NULL_TINYINT
SQLTypes type
Definition: sqltypes.h:730
#define NULL_SMALLINT

◆ is_null_fixlen_array()

HOST DEVICE bool SQLTypeInfo::is_null_fixlen_array ( const int8_t *  val,
int  array_size 
) const
inline

Definition at line 651 of file sqltypes.h.

References kARRAY, kDOUBLE, kFLOAT, kNULLT, NULL_ARRAY_BIGINT, NULL_ARRAY_DOUBLE, NULL_ARRAY_FLOAT, NULL_ARRAY_INT, NULL_ARRAY_SMALLINT, NULL_ARRAY_TINYINT, and run_benchmark_import::type.

Referenced by ChunkIter_get_nth().

651  {
652  // Check if fixed length array has a NULL_ARRAY sentinel as the first element
653  if (type == kARRAY && val && array_size > 0 && array_size == size) {
654  // Need to create element type to get the size, but can't call get_elem_type()
655  // since this is a HOST DEVICE function. Going through copy constructor instead.
656  auto elem_ti{*this};
657  elem_ti.set_type(subtype);
658  elem_ti.set_subtype(kNULLT);
659  auto elem_size = elem_ti.get_storage_size();
660  if (elem_size < 1) {
661  return false;
662  }
663  if (subtype == kFLOAT) {
664  return *(float*)val == NULL_ARRAY_FLOAT;
665  }
666  if (subtype == kDOUBLE) {
667  return *(double*)val == NULL_ARRAY_DOUBLE;
668  }
669  switch (elem_size) {
670  case 1:
671  return *val == NULL_ARRAY_TINYINT;
672  case 2:
673  return *(int16_t*)val == NULL_ARRAY_SMALLINT;
674  case 4:
675  return *(int32_t*)val == NULL_ARRAY_INT;
676  case 8:
677  return *(int64_t*)val == NULL_ARRAY_BIGINT;
678  default:
679  return false;
680  }
681  }
682  return false;
683  }
#define NULL_ARRAY_INT
#define NULL_ARRAY_SMALLINT
#define NULL_ARRAY_TINYINT
SQLTypes subtype
Definition: sqltypes.h:731
#define NULL_ARRAY_FLOAT
#define NULL_ARRAY_DOUBLE
SQLTypes type
Definition: sqltypes.h:730
#define NULL_ARRAY_BIGINT
+ Here is the caller graph for this function:

◆ is_null_point_coord_array()

HOST DEVICE bool SQLTypeInfo::is_null_point_coord_array ( const int8_t *  val,
int  array_size 
) const
inline

Definition at line 684 of file sqltypes.h.

References kARRAY, kTINYINT, NULL_ARRAY_COMPRESSED_32, NULL_ARRAY_DOUBLE, and run_benchmark_import::type.

Referenced by ChunkIter_get_nth_point_coords().

685  {
686  if (type == kARRAY && subtype == kTINYINT && val && array_size > 0 &&
687  array_size == size) {
688  if (array_size == 2 * sizeof(double)) {
689  return *(double*)val == NULL_ARRAY_DOUBLE;
690  }
691  if (array_size == 2 * sizeof(int32_t)) {
692  return *(uint32_t*)val == NULL_ARRAY_COMPRESSED_32;
693  }
694  }
695  return false;
696  }
#define NULL_ARRAY_COMPRESSED_32
SQLTypes subtype
Definition: sqltypes.h:731
#define NULL_ARRAY_DOUBLE
SQLTypes type
Definition: sqltypes.h:730
+ Here is the caller graph for this function:

◆ is_number()

◆ is_string()

bool SQLTypeInfo::is_string ( ) const
inline

Definition at line 478 of file sqltypes.h.

References IS_STRING, and run_benchmark_import::type.

Referenced by Analyzer::Expr::add_cast(), Analyzer::UOper::add_cast(), Analyzer::CaseExpr::add_cast(), Parser::InValues::analyze(), Parser::FunctionRef::analyze(), Parser::QuerySpec::analyze_group_by(), Analyzer::BinOper::analyze_type_info(), CodeGenerator::castArrayPointer(), CodeGenerator::codegenCast(), CodeGenerator::codegenCastFromString(), CodeGenerator::codegenCmp(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codegenHoistedConstantsPlaceholders(), Analyzer::BinOper::common_string_type(), Encoder::Create(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::create_parquet_none_type_encoder(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::create_parquet_string_encoder(), CodeGenerator::createInValuesBitmap(), Analyzer::Constant::deep_copy(), Catalog_Namespace::Catalog::delDictionary(), Parser::InsertValuesStmt::determineLeafIndex(), Analyzer::Constant::do_cast(), RelAlgExecutor::executeSimpleInsert(), get_agg_initial_val(), anonymous_namespace{TargetExprBuilder.cpp}::get_initial_agg_val(), foreign_storage::get_var_length_data_block_size(), Catalog_Namespace::Catalog::getColumnDictDirectory(), import_export::Loader::getStringDict(), ResultSet::getTargetValueFromBufferRowwise(), CodeGenerator::hashJoinLhs(), inline_fixed_encoding_null_val(), inline_int_null_val(), anonymous_namespace{Execute.cpp}::inline_null_val(), CgenState::inlineIntNull(), is_castable(), foreign_storage::csv_file_buffer_parser::is_null_datum(), is_real_str_or_array(), is_supported_type_for_extern_execution(), Fragmenter_Namespace::isStringVectorData(), ResultSet::makeVarlenTargetValue(), Parser::CaseExpr::normalize(), null_val_bit_pattern(), import_export::NullArray(), numeric_type_name(), Parser::InsertIntoTableAsSelectStmt::populateData(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), ResultSetReductionJIT::reduceOneSlot(), ResultSetStorage::reduceOneSlot(), ddl_utils::set_default_encoding(), import_export::StringToArray(), import_export::TDatumToArrayDatum(), ExpressionRange::typeSupportsRange(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumns(), anonymous_namespace{InputMetadata.cpp}::uses_int_meta(), ddl_utils::validate_and_set_dictionary_encoding(), ddl_utils::validate_and_set_none_encoding(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_string_mapping(), and Analyzer::Constant::~Constant().

478 { return IS_STRING(type); }
#define IS_STRING(T)
Definition: sqltypes.h:241
SQLTypes type
Definition: sqltypes.h:730

◆ is_string_array()

bool SQLTypeInfo::is_string_array ( ) const
inline

Definition at line 479 of file sqltypes.h.

References IS_STRING, kARRAY, and run_benchmark_import::type.

Referenced by Catalog_Namespace::Catalog::delDictionary(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), Catalog_Namespace::Catalog::getColumnDictDirectory(), ddl_utils::set_default_encoding(), ddl_utils::validate_and_set_array_size(), ddl_utils::validate_and_set_dictionary_encoding(), and ddl_utils::validate_and_set_none_encoding().

479 { return (type == kARRAY) && IS_STRING(subtype); }
SQLTypes subtype
Definition: sqltypes.h:731
#define IS_STRING(T)
Definition: sqltypes.h:241
SQLTypes type
Definition: sqltypes.h:730
+ Here is the caller graph for this function:

◆ is_time()

bool SQLTypeInfo::is_time ( ) const
inline

Definition at line 484 of file sqltypes.h.

References is_datetime(), and run_benchmark_import::type.

Referenced by Analyzer::Constant::add_cast(), Analyzer::BinOper::analyze_type_info(), CodeGenerator::codegenCast(), CodeGenerator::codegenCmp(), CodeGenerator::codegenHoistedConstantsLoads(), NumericConverterFactory< SOURCE_TYPE, TARGET_TYPE >::create(), anonymous_namespace{ArrowResultSetConverter.cpp}::create_or_append_validity(), datum_to_string(), Analyzer::Constant::do_cast(), inline_fixed_encoding_null_val(), anonymous_namespace{Execute.cpp}::inline_null_val(), anonymous_namespace{RelAlgTranslator.cpp}::is_agg_supported_for_type(), Fragmenter_Namespace::is_integral(), CodeGenerator::NullCheckCodegen::NullCheckCodegen(), numeric_type_name(), Parser::InsertIntoTableAsSelectStmt::populateData(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), Executor::reduceResults(), import_export::StringToArray(), ExpressionRange::typeSupportsRange(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), and anonymous_namespace{InputMetadata.cpp}::uses_int_meta().

484 { return is_datetime(type); }
SQLTypes type
Definition: sqltypes.h:730
constexpr auto is_datetime(SQLTypes type)
Definition: sqltypes.h:254
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_timeinterval()

bool SQLTypeInfo::is_timeinterval ( ) const
inline

◆ is_timestamp()

◆ is_varlen()

bool SQLTypeInfo::is_varlen ( ) const
inline

◆ is_varlen_array()

bool SQLTypeInfo::is_varlen_array ( ) const
inline

Definition at line 487 of file sqltypes.h.

References kARRAY, and run_benchmark_import::type.

487 { return type == kARRAY && size <= 0; }
SQLTypes type
Definition: sqltypes.h:730

◆ is_varlen_indeed()

bool SQLTypeInfo::is_varlen_indeed ( ) const
inline

Definition at line 506 of file sqltypes.h.

Referenced by foreign_storage::anonymous_namespace{CsvDataWrapper.cpp}::add_placeholder_metadata(), and foreign_storage::cache_blocks().

506  {
507  // SQLTypeInfo.is_varlen() is broken with fixedlen array now
508  // and seems left broken for some concern, so fix it locally
509  return is_varlen() && !is_fixlen_array();
510  }
bool is_varlen() const
Definition: sqltypes.h:500
bool is_fixlen_array() const
Definition: sqltypes.h:488
+ Here is the caller graph for this function:

◆ operator!=()

HOST DEVICE bool SQLTypeInfo::operator!= ( const SQLTypeInfo rhs) const
inline

Definition at line 521 of file sqltypes.h.

References get_comp_param(), get_compression(), get_dimension(), get_notnull(), get_scale(), get_subtype(), get_type(), kENCODING_NONE, TRANSIENT_DICT, and run_benchmark_import::type.

521  {
522  return type != rhs.get_type() || subtype != rhs.get_subtype() ||
523  dimension != rhs.get_dimension() || scale != rhs.get_scale() ||
524  compression != rhs.get_compression() ||
527  notnull != rhs.get_notnull();
528  }
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:320
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:319
HOST DEVICE int get_scale() const
Definition: sqltypes.h:316
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:318
SQLTypes subtype
Definition: sqltypes.h:731
bool notnull
Definition: sqltypes.h:734
HOST DEVICE SQLTypes get_subtype() const
Definition: sqltypes.h:312
EncodingType compression
Definition: sqltypes.h:735
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:313
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:311
SQLTypes type
Definition: sqltypes.h:730
#define TRANSIENT_DICT(ID)
Definition: sqltypes.h:251
int comp_param
Definition: sqltypes.h:736
int dimension
Definition: sqltypes.h:732
+ Here is the call graph for this function:

◆ operator=()

HOST DEVICE void SQLTypeInfo::operator= ( const SQLTypeInfo rhs)
inline

Definition at line 549 of file sqltypes.h.

References get_comp_param(), get_compression(), get_dimension(), get_notnull(), get_scale(), get_size(), get_subtype(), get_type(), and run_benchmark_import::type.

549  {
550  type = rhs.get_type();
551  subtype = rhs.get_subtype();
552  dimension = rhs.get_dimension();
553  scale = rhs.get_scale();
554  notnull = rhs.get_notnull();
556  comp_param = rhs.get_comp_param();
557  size = rhs.get_size();
558  }
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:320
HOST DEVICE int get_size() const
Definition: sqltypes.h:321
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:319
HOST DEVICE int get_scale() const
Definition: sqltypes.h:316
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:318
SQLTypes subtype
Definition: sqltypes.h:731
bool notnull
Definition: sqltypes.h:734
HOST DEVICE SQLTypes get_subtype() const
Definition: sqltypes.h:312
EncodingType compression
Definition: sqltypes.h:735
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:313
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:311
SQLTypes type
Definition: sqltypes.h:730
int comp_param
Definition: sqltypes.h:736
int dimension
Definition: sqltypes.h:732
+ Here is the call graph for this function:

◆ operator==()

HOST DEVICE bool SQLTypeInfo::operator== ( const SQLTypeInfo rhs) const
inline

Definition at line 529 of file sqltypes.h.

References get_comp_param(), get_compression(), get_dimension(), get_notnull(), get_scale(), get_subtype(), get_type(), kENCODING_NONE, TRANSIENT_DICT, and run_benchmark_import::type.

529  {
530  return type == rhs.get_type() && subtype == rhs.get_subtype() &&
531  dimension == rhs.get_dimension() && scale == rhs.get_scale() &&
532  compression == rhs.get_compression() &&
535  notnull == rhs.get_notnull();
536  }
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:320
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:319
HOST DEVICE int get_scale() const
Definition: sqltypes.h:316
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:318
SQLTypes subtype
Definition: sqltypes.h:731
bool notnull
Definition: sqltypes.h:734
HOST DEVICE SQLTypes get_subtype() const
Definition: sqltypes.h:312
EncodingType compression
Definition: sqltypes.h:735
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:313
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:311
SQLTypes type
Definition: sqltypes.h:730
#define TRANSIENT_DICT(ID)
Definition: sqltypes.h:251
int comp_param
Definition: sqltypes.h:736
int dimension
Definition: sqltypes.h:732
+ Here is the call graph for this function:

◆ set_comp_param()

◆ set_compression()

◆ set_dimension()

void SQLTypeInfo::set_dimension ( int  d)
inline

Definition at line 403 of file sqltypes.h.

Referenced by Analyzer::BinOper::analyze_type_info(), Catalog_Namespace::Catalog::buildMaps(), parse_numeric(), File_Namespace::FileBuffer::readMetadata(), and ddl_utils::validate_and_set_type().

403 { dimension = d; }
int dimension
Definition: sqltypes.h:732
+ Here is the caller graph for this function:

◆ set_fixed_size()

void SQLTypeInfo::set_fixed_size ( )
inline

Definition at line 410 of file sqltypes.h.

Referenced by Parser::QuerySpec::analyze_group_by(), Analyzer::BinOper::common_numeric_type(), import_export::Importer::gdalToColumnDescriptors(), Parser::OperExpr::normalize(), and ddl_utils::validate_and_set_array_size().

410 { size = get_storage_size(); }
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:742
+ Here is the caller graph for this function:

◆ set_input_srid()

void SQLTypeInfo::set_input_srid ( int  d)
inline

Definition at line 405 of file sqltypes.h.

Referenced by import_export::Importer::gdalToColumnDescriptors(), RelAlgTranslator::translateGeoFunctionArg(), RelAlgTranslator::translateGeoLiteral(), and ddl_utils::validate_and_set_type().

405 { dimension = d; }
int dimension
Definition: sqltypes.h:732
+ Here is the caller graph for this function:

◆ set_notnull()

void SQLTypeInfo::set_notnull ( bool  n)
inline

Definition at line 408 of file sqltypes.h.

Referenced by Analyzer::BinOper::analyze_type_info(), Catalog_Namespace::Catalog::buildMaps(), get_compact_type(), get_nullable_type_info(), Parser::CaseExpr::normalize(), parse_numeric(), File_Namespace::FileBuffer::readMetadata(), and ddl_utils::set_column_descriptor().

408 { notnull = n; }
bool notnull
Definition: sqltypes.h:734
+ Here is the caller graph for this function:

◆ set_output_srid()

void SQLTypeInfo::set_output_srid ( int  s)
inline

Definition at line 407 of file sqltypes.h.

Referenced by import_export::Importer::gdalToColumnDescriptors(), RelAlgTranslator::translateGeoBinaryConstructor(), RelAlgTranslator::translateGeoFunctionArg(), RelAlgTranslator::translateGeoLiteral(), and ddl_utils::validate_and_set_type().

407 { scale = s; }
+ Here is the caller graph for this function:

◆ set_precision()

void SQLTypeInfo::set_precision ( int  d)
inline

Definition at line 404 of file sqltypes.h.

Referenced by Parser::FixedPtLiteral::analyzeValue(), anonymous_namespace{RelAlgTranslator.cpp}::build_type_info(), and anonymous_namespace{RelAlgDagBuilder.cpp}::parse_type().

404 { dimension = d; }
int dimension
Definition: sqltypes.h:732
+ Here is the caller graph for this function:

◆ set_scale()

void SQLTypeInfo::set_scale ( int  s)
inline

◆ set_size()

void SQLTypeInfo::set_size ( int  s)
inline

◆ set_subtype()

HOST DEVICE void SQLTypeInfo::set_subtype ( SQLTypes  st)
inline

Definition at line 402 of file sqltypes.h.

Referenced by Parser::ArrayLiteral::analyze(), Catalog_Namespace::Catalog::buildMaps(), Catalog_Namespace::Catalog::expandGeoColumn(), import_export::Importer::gdalToColumnDescriptors(), File_Namespace::FileBuffer::readMetadata(), RelAlgTranslator::translateGeoFunctionArg(), RelAlgTranslator::translateGeoLiteral(), and ddl_utils::validate_and_set_type().

402 { subtype = st; }
SQLTypes subtype
Definition: sqltypes.h:731
+ Here is the caller graph for this function:

◆ set_type()

HOST DEVICE void SQLTypeInfo::set_type ( SQLTypes  t)
inline

Definition at line 401 of file sqltypes.h.

References run_benchmark_import::type.

Referenced by Catalog_Namespace::Catalog::buildMaps(), import_export::Importer::gdalToColumnDescriptors(), Geospatial::GeoTypesFactory::getGeoColumnsImpl(), File_Namespace::FileBuffer::readMetadata(), RelAlgTranslator::translateGeoBinaryConstructor(), RelAlgTranslator::translateGeoFunctionArg(), and ddl_utils::validate_and_set_type().

401 { type = t; }
SQLTypes type
Definition: sqltypes.h:730
+ Here is the caller graph for this function:

◆ to_string()

std::string SQLTypeInfo::to_string ( ) const
inline

Definition at line 446 of file sqltypes.h.

References concat(), run_benchmark_import::type, and type_name().

Referenced by RelLogicalUnion::checkForMatchingMetaInfoTypes(), DatumToString(), operator<<(), TargetMetaInfo::toString(), and TargetInfo::toString().

446  {
447  return concat("(",
448  type_name[static_cast<int>(type)],
449  ", ",
450  get_dimension(),
451  ", ",
452  get_scale(),
453  ", ",
454  get_notnull() ? "not nullable" : "nullable",
455  ", ",
457  ", ",
458  get_comp_param(),
459  ", ",
460  type_name[static_cast<int>(subtype)],
461  ": ",
462  get_size(),
463  ": ",
465  ")");
466  }
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:320
HOST DEVICE int get_size() const
Definition: sqltypes.h:321
HOST DEVICE int get_scale() const
Definition: sqltypes.h:316
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:318
std::string concat(Types &&... parms)
static std::string type_name[kSQLTYPE_LAST]
Definition: sqltypes.h:739
SQLTypes subtype
Definition: sqltypes.h:731
std::string get_compression_name() const
Definition: sqltypes.h:445
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:313
SQLTypeInfo get_elem_type() const
Definition: sqltypes.h:697
SQLTypes type
Definition: sqltypes.h:730
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transforms()

bool SQLTypeInfo::transforms ( ) const
inline

Definition at line 496 of file sqltypes.h.

References IS_GEO, and run_benchmark_import::type.

Referenced by CodeGenerator::codegenGeoBinOper(), CodeGenerator::codegenGeoUOper(), and import_export::importGeoFromLonLat().

496  {
497  return IS_GEO(type) && get_output_srid() != get_input_srid();
498  }
HOST DEVICE int get_output_srid() const
Definition: sqltypes.h:317
HOST DEVICE int get_input_srid() const
Definition: sqltypes.h:315
SQLTypes type
Definition: sqltypes.h:730
#define IS_GEO(T)
Definition: sqltypes.h:242
+ Here is the caller graph for this function:

Member Data Documentation

◆ comp_name

std::string SQLTypeInfo::comp_name
staticprivate
Initial value:
=
{"NONE", "FIXED", "RL", "DIFF", "DICT", "SPARSE", "COMPRESSED", "DAYS"}

Definition at line 740 of file sqltypes.h.

◆ comp_param

int SQLTypeInfo::comp_param
private

Definition at line 736 of file sqltypes.h.

◆ compression

EncodingType SQLTypeInfo::compression
private

Definition at line 735 of file sqltypes.h.

◆ dimension

int SQLTypeInfo::dimension
private

Definition at line 732 of file sqltypes.h.

◆ notnull

bool SQLTypeInfo::notnull
private

Definition at line 734 of file sqltypes.h.

◆ scale

int SQLTypeInfo::scale
private

Definition at line 733 of file sqltypes.h.

◆ size

int SQLTypeInfo::size
private

Definition at line 737 of file sqltypes.h.

◆ subtype

SQLTypes SQLTypeInfo::subtype
private

Definition at line 731 of file sqltypes.h.

◆ type

◆ type_name

std::string SQLTypeInfo::type_name
staticprivate
Initial value:
= {"NULL",
"BOOLEAN",
"CHAR",
"VARCHAR",
"NUMERIC",
"DECIMAL",
"INTEGER",
"SMALLINT",
"FLOAT",
"DOUBLE",
"TIME",
"TIMESTAMP",
"BIGINT",
"TEXT",
"DATE",
"ARRAY",
"INTERVAL_DAY_TIME",
"INTERVAL_YEAR_MONTH",
"POINT",
"LINESTRING",
"POLYGON",
"MULTIPOLYGON",
"TINYINT",
"GEOMETRY",
"GEOGRAPHY",
"EVAL_CONTEXT_TYPE",
"VOID",
"CURSOR",
"COLUMN"}

Definition at line 739 of file sqltypes.h.


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