OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SQLTypeInfo Class Reference

#include <sqltypes.h>

+ Collaboration diagram for SQLTypeInfo:

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, EncodingType c, int p, SQLTypes st)
 
 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
 
HOST DEVICE size_t get_max_strlen () const
 
int is_logical_geo_type () const
 
int get_logical_size () const
 
int get_physical_cols () const
 
int get_physical_coord_cols () const
 
bool has_bounds () 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_dict_intersection ()
 
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 toString () const
 
std::string to_string () const
 
std::string get_buffer_name () const
 
template<SQLTypes... types>
bool is_any () 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_column_list () const
 
bool is_column_array () const
 
bool is_column_list_array () const
 
bool is_text_encoding_none () const
 
bool is_text_encoding_dict () const
 
bool is_text_encoding_dict_array () 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_none_encoded_string () const
 
bool is_subtype_dict_encoded_string () const
 
bool is_dict_encoded_type () const
 
bool is_dict_intersection () const
 
bool has_same_itemtype (const SQLTypeInfo &other) 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
 
bool is_numeric_scalar_auto_castable (const SQLTypeInfo &new_type_info) const
 returns true if the sql_type can be cast to the type specified by new_type_info with no loss of precision. Currently only used in ExtensionFunctionsBindings to determine legal function matches, but we should consider whether we need to rationalize implicit casting behavior more broadly in QueryEngine. More...
 
int32_t get_numeric_scalar_scale () const
 returns integer between 1 and 8 indicating what is roughly equivalent to the logical byte size of a scalar numeric type (including boolean + time types), but with decimals and numerics mapped to the byte size of their dimension (which may vary from the type width), and timestamps, dates and times handled in a relative fashion. Note: this function only takes the scalar numeric types above, and will throw a check for other types. More...
 
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_time_or_date () const
 
bool is_high_precision_timestamp () const
 
bool is_timestamp () const
 
bool is_encoded_timestamp () const
 
void setStorageSize ()
 
const shared::StringDictKeygetStringDictKey () const
 
void setStringDictKey (const shared::StringDictKey &dict_key)
 
const shared::StringDictKeygetStringDictKeySkipCompParamCheck () const
 
void setStringDictKeySkipCompParamCheck (const shared::StringDictKey &dict_key)
 
void setUsesFlatBuffer (bool uses_flatbuffer=true)
 
bool usesFlatBuffer () const
 
bool supportsFlatBuffer () const
 
SQLTypeInfoLite toLite () const
 
FlatBufferManager::ValueType toValueType () 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
 
bool dict_intersection {false}
 
shared::StringDictKey dict_key_
 
bool uses_flatbuffer_ {false}
 

Static Private Attributes

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

Detailed Description

Definition at line 332 of file sqltypes.h.

Constructor & Destructor Documentation

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

Definition at line 334 of file sqltypes.h.

335  : type(t)
336  , subtype(st)
337  , dimension(d)
338  , scale(s)
339  , notnull(n)
340  , compression(c)
341  , comp_param(p)
342  , size(get_storage_size()) {}
SQLTypes subtype
Definition: sqltypes.h:1269
bool notnull
Definition: sqltypes.h:1273
EncodingType compression
Definition: sqltypes.h:1274
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:1284
SQLTypes type
Definition: sqltypes.h:1268
constexpr double n
Definition: Utm.h:38
int comp_param
Definition: sqltypes.h:1275
int dimension
Definition: sqltypes.h:1270
SQLTypeInfo::SQLTypeInfo ( SQLTypes  t,
int  d,
int  s,
bool  n 
)
inline

Definition at line 343 of file sqltypes.h.

344  : type(t)
345  , subtype(kNULLT)
346  , dimension(d)
347  , scale(s)
348  , notnull(n)
350  , comp_param(0)
351  , size(get_storage_size()) {}
SQLTypes subtype
Definition: sqltypes.h:1269
bool notnull
Definition: sqltypes.h:1273
EncodingType compression
Definition: sqltypes.h:1274
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:1284
SQLTypes type
Definition: sqltypes.h:1268
constexpr double n
Definition: Utm.h:38
int comp_param
Definition: sqltypes.h:1275
int dimension
Definition: sqltypes.h:1270
SQLTypeInfo::SQLTypeInfo ( SQLTypes  t,
EncodingType  c,
int  p,
SQLTypes  st 
)
inline

Definition at line 352 of file sqltypes.h.

353  : type(t)
354  , subtype(st)
355  , dimension(0)
356  , scale(0)
357  , notnull(false)
358  , compression(c)
359  , comp_param(p)
360  , size(get_storage_size()) {}
SQLTypes subtype
Definition: sqltypes.h:1269
bool notnull
Definition: sqltypes.h:1273
EncodingType compression
Definition: sqltypes.h:1274
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:1284
SQLTypes type
Definition: sqltypes.h:1268
int comp_param
Definition: sqltypes.h:1275
int dimension
Definition: sqltypes.h:1270
SQLTypeInfo::SQLTypeInfo ( SQLTypes  t,
int  d,
int  s 
)
inline

Definition at line 361 of file sqltypes.h.

361 : SQLTypeInfo(t, d, s, false) {}
SQLTypeInfo::SQLTypeInfo ( SQLTypes  t,
bool  n 
)
inline

Definition at line 362 of file sqltypes.h.

363  : type(t)
364  , subtype(kNULLT)
365  , dimension(0)
366  , scale(0)
367  , notnull(n)
369  , comp_param(0)
370  , size(get_storage_size()) {}
SQLTypes subtype
Definition: sqltypes.h:1269
bool notnull
Definition: sqltypes.h:1273
EncodingType compression
Definition: sqltypes.h:1274
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:1284
SQLTypes type
Definition: sqltypes.h:1268
constexpr double n
Definition: Utm.h:38
int comp_param
Definition: sqltypes.h:1275
int dimension
Definition: sqltypes.h:1270
SQLTypeInfo::SQLTypeInfo ( SQLTypes  t)
inline

Definition at line 371 of file sqltypes.h.

371 : SQLTypeInfo(t, false) {}
SQLTypeInfo::SQLTypeInfo ( SQLTypes  t,
bool  n,
EncodingType  c 
)
inline

Definition at line 372 of file sqltypes.h.

373  : type(t)
374  , subtype(kNULLT)
375  , dimension(0)
376  , scale(0)
377  , notnull(n)
378  , compression(c)
379  , comp_param(0)
380  , size(get_storage_size()) {}
SQLTypes subtype
Definition: sqltypes.h:1269
bool notnull
Definition: sqltypes.h:1273
EncodingType compression
Definition: sqltypes.h:1274
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:1284
SQLTypes type
Definition: sqltypes.h:1268
constexpr double n
Definition: Utm.h:38
int comp_param
Definition: sqltypes.h:1275
int dimension
Definition: sqltypes.h:1270
SQLTypeInfo::SQLTypeInfo ( )
inline

Definition at line 381 of file sqltypes.h.

382  : type(kNULLT)
383  , subtype(kNULLT)
384  , dimension(0)
385  , scale(0)
386  , notnull(false)
388  , comp_param(0)
389  , size(0) {}
SQLTypes subtype
Definition: sqltypes.h:1269
bool notnull
Definition: sqltypes.h:1273
EncodingType compression
Definition: sqltypes.h:1274
SQLTypes type
Definition: sqltypes.h:1268
int comp_param
Definition: sqltypes.h:1275
int dimension
Definition: sqltypes.h:1270

Member Function Documentation

int SQLTypeInfo::get_array_context_logical_size ( ) const
inline

Definition at line 689 of file sqltypes.h.

References get_compression(), get_logical_size(), is_string(), kENCODING_DICT, kENCODING_FIXED, and kENCODING_NONE.

Referenced by ResultSet::makeVarlenTargetValue().

689  {
690  if (is_string()) {
691  auto comp_type(get_compression());
692  if (comp_type == kENCODING_DICT || comp_type == kENCODING_FIXED ||
693  comp_type == kENCODING_NONE) {
694  return sizeof(int32_t);
695  }
696  }
697  return get_logical_size();
698  }
int get_logical_size() const
Definition: sqltypes.h:419
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399
bool is_string() const
Definition: sqltypes.h:559

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

SQLTypeInfo SQLTypeInfo::get_array_type ( ) const
inline

Definition at line 1008 of file sqltypes.h.

References kARRAY, set_subtype(), set_type(), setStorageSize(), and type.

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

1008  {
1009  SQLTypeInfo type_info = *this;
1010  type_info.set_type(kARRAY);
1011  type_info.set_subtype(type);
1012  type_info.setStorageSize();
1013  return type_info;
1014  }
HOST DEVICE void set_subtype(SQLTypes st)
Definition: sqltypes.h:469
void setStorageSize()
Definition: sqltypes.h:1051
SQLTypes type
Definition: sqltypes.h:1268
HOST DEVICE void set_type(SQLTypes t)
Definition: sqltypes.h:468

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 539 of file sqltypes.h.

References is_array(), is_column(), and is_text_encoding_none().

539  {
540  if (is_array()) {
541  return "Array";
542  }
543  if (is_text_encoding_none()) {
544  return "TextEncodingNone";
545  }
546 
547  if (is_column()) {
548  return "Column";
549  }
550 
551  assert(false);
552  return "";
553  }
bool is_column() const
Definition: sqltypes.h:598
bool is_text_encoding_none() const
Definition: sqltypes.h:612
bool is_array() const
Definition: sqltypes.h:583

+ Here is the call graph for this function:

HOST DEVICE int SQLTypeInfo::get_comp_param ( ) const
inline

Definition at line 402 of file sqltypes.h.

References comp_param.

Referenced by Analyzer::CaseExpr::add_cast(), Catalog_Namespace::Catalog::addColumn(), Catalog_Namespace::Catalog::addColumnNontransactional(), Catalog_Namespace::Catalog::addReferenceToForeignDict(), Catalog_Namespace::Catalog::alterColumnTypeTransactional(), CodeGenerator::codegenCompression(), Analyzer::BinOper::common_string_type(), ddl_utils::alter_column_utils::compare_sql_type_infos(), import_export::ImporterUtils::composeNullPointCoords(), 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(), DateDaysOverflowValidator::DateDaysOverflowValidator(), decompress(), Catalog_Namespace::Catalog::delDictionaryNontransactional(), Catalog_Namespace::Catalog::doTruncateTable(), import_export::fill_missing_columns(), Catalog_Namespace::Catalog::gatherAdditionalInfo(), generate_column_type(), anonymous_namespace{DdlCommandExecutor.cpp}::get_alter_column_src_dst_cds(), anonymous_namespace{ColumnIR.cpp}::get_col_decoder(), Geospatial::get_compression_scheme(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), anonymous_namespace{WindowFunctionIR.cpp}::get_null_value_by_size(), Catalog_Namespace::Catalog::getColumnDictDirectory(), 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!=(), operator=(), operator==(), anonymous_namespace{Datum.cpp}::parseInteger(), DBHandler::populateThriftColumnType(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), Catalog_Namespace::Catalog::refreshDictionaryCachesForTableUnlocked(), Catalog_Namespace::Catalog::removeTableFromMap(), boost::serialization::save(), json_utils::set_value(), Catalog_Namespace::Catalog::setColumnDictionary(), Catalog_Namespace::Catalog::setColumnSharedDictionary(), to_string(), Analyzer::UOper::toString(), RelAlgTranslator::translateBinaryGeoFunction(), 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().

402 { return comp_param; }
int comp_param
Definition: sqltypes.h:1275
HOST DEVICE EncodingType SQLTypeInfo::get_compression ( ) const
inline

Definition at line 399 of file sqltypes.h.

References compression.

Referenced by Analyzer::Expr::add_cast(), Analyzer::Constant::add_cast(), Analyzer::UOper::add_cast(), Analyzer::CaseExpr::add_cast(), Catalog_Namespace::Catalog::addColumn(), Catalog_Namespace::Catalog::addColumnNontransactional(), anonymous_namespace{TableFunctionCompilationContext.cpp}::alloc_column(), anonymous_namespace{TableFunctionCompilationContext.cpp}::alloc_column_list(), Catalog_Namespace::Catalog::alterColumnTypeTransactional(), Parser::InValues::analyze(), Parser::FunctionRef::analyze(), Parser::QuerySpec::analyze_group_by(), CodeGenerator::castArrayPointer(), ChunkIter_get_next(), ChunkIter_get_nth(), import_export::TypedImportBuffer::clear(), spatial_type::NPoints::codegen(), TargetExprCodegen::codegenAggregate(), CodeGenerator::codegenCastFromString(), CodeGenerator::codegenCastNonStringToString(), CodeGenerator::codegenCmp(), CodeGenerator::codegenCompression(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codgenAdjustFixedEncNull(), Analyzer::BinOper::common_string_type(), ddl_utils::alter_column_utils::compare_sql_type_infos(), import_export::ImporterUtils::composeNullPointCoords(), Geospatial::compress_coord(), Geospatial::compress_coords(), Geospatial::compress_null_point(), anonymous_namespace{ColumnarResults.cpp}::computeTotalNofValuesForColumnGeoType(), anonymous_namespace{RelAlgExecutor.cpp}::anonymous_namespace{RelAlgExecutor.cpp}::conditionally_change_arg_to_int_type(), Geospatial::convert_coords(), ResultSet::convertToScalarTargetValue(), Encoder::Create(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::create_parquet_decimal_encoder(), Catalog_Namespace::Catalog::createTable(), DatumEqual(), decompress(), Analyzer::Expr::decompress(), Catalog_Namespace::Catalog::delDictionaryNontransactional(), Catalog_Namespace::Catalog::doTruncateTable(), encoding_to_thrift(), RelAlgExecutor::executeSimpleInsert(), extract_int_type_from_datum(), import_export::fill_missing_columns(), ChunkMetadata::fillChunkStats(), anonymous_namespace{ColumnarResults.cpp}::fixed_encoding_nullable_val(), Catalog_Namespace::Catalog::gatherAdditionalInfo(), generate_column_type(), get_array_context_logical_size(), Analyzer::ColumnVar::get_compression(), Geospatial::get_compression_scheme(), get_elem_type(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), anonymous_namespace{TargetExprBuilder.cpp}::get_initial_agg_val(), anonymous_namespace{TableFunctionCompilationContext.cpp}::get_llvm_type_from_sql_column_type(), get_logical_type_info(), get_null_value(), anonymous_namespace{WindowFunctionIR.cpp}::get_null_value_by_size(), anonymous_namespace{WindowFunctionIR.cpp}::get_null_value_by_size_with_encoding(), Parser::get_str_dict_cast_type(), Parser::LocalQueryConnector::getColumnDescriptors(), Catalog_Namespace::Catalog::getColumnDictDirectory(), getFlatBufferNDimsAndSizes(), getFlatBufferSize(), Chunk_NS::Chunk::getNumElemsForBytesInsertData(), import_export::Loader::getStringDict(), ResultSet::getTargetValueFromBufferRowwise(), has_same_itemtype(), Chunk_NS::Chunk::initEncoder(), initializeFlatBuffer(), inline_fixed_encoding_null_val(), inline_int_null_val(), CgenState::inlineIntNull(), is_column_array(), is_column_list_array(), is_date_in_days(), FixedLengthArrayNoneEncoder::is_null_ignore_not_null(), Geospatial::is_null_point(), is_real_str_or_array(), is_text_encoding_dict(), is_text_encoding_dict_array(), is_text_encoding_none(), is_unsigned_type(), RangeJoinHashTable::isInnerColCompressed(), ResultSet::isLessThan(), ChunkMetadata::isPlaceholder(), Fragmenter_Namespace::isStringVectorData(), ResultSet::makeGeoTargetValue(), ResultSet::makeVarlenTargetValue(), anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_arguments(), NestedArrayToGeoTargetValue(), Parser::OperExpr::normalize(), null_val_bit_pattern(), numeric_type_name(), operator!=(), TextConverterFactory::operator()(), operator=(), operator==(), anonymous_namespace{Datum.cpp}::parseInteger(), Parser::InsertIntoTableAsSelectStmt::populateData(), DBHandler::populateThriftColumnType(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), Catalog_Namespace::Catalog::refreshDictionaryCachesForTableUnlocked(), Catalog_Namespace::Catalog::removeTableFromMap(), boost::serialization::save(), anonymous_namespace{TableOptimizer.cpp}::set_metadata_from_results(), json_utils::set_value(), Chunk_NS::Chunk::setChunkBuffer(), Fragmenter_Namespace::size_of_raw_column(), supportsFlatBuffer(), toLite(), toValueType(), RelAlgTranslator::translateBinaryGeoFunction(), RelAlgTranslator::translateGeoFunctionArg(), RelAlgTranslator::translateGeoLiteral(), ThriftSerializers::type_info_to_thrift(), 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< NullType >::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(), ColumnarResults::writeBackCell(), writeBackCellGeoNestedArray(), writeBackCellGeoPoint(), File_Namespace::FileBuffer::writeMetadata(), and import_export::TypedImportBuffer::~TypedImportBuffer().

399 { return compression; }
EncodingType compression
Definition: sqltypes.h:1274
std::string SQLTypeInfo::get_compression_name ( ) const
inline

Definition at line 520 of file sqltypes.h.

References comp_name, and compression.

Referenced by to_string(), and Analyzer::UOper::toString().

520  {
521  return comp_name[(int)compression];
522  }
EncodingType compression
Definition: sqltypes.h:1274
static std::string comp_name[kENCODING_LAST]
Definition: sqltypes.h:1280

+ Here is the caller graph for this function:

HOST DEVICE int SQLTypeInfo::get_dimension ( ) const
inline

Definition at line 393 of file sqltypes.h.

References dimension.

Referenced by Catalog_Namespace::Catalog::addColumn(), Catalog_Namespace::Catalog::addColumnNontransactional(), Catalog_Namespace::Catalog::alterColumnTypeTransactional(), Analyzer::BinOper::analyze_type_info(), Analyzer::Constant::cast_string(), Analyzer::Constant::cast_to_string(), CodeGenerator::codegenCast(), CodeGenerator::codegenCastBetweenTimestamps(), CodeGenerator::codegenCastNonStringToString(), CodeGenerator::codegenDateTruncHighPrecisionTimestamps(), CodeGenerator::codegenExtractHighPrecisionTimestamps(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codgenAdjustFixedEncNull(), Analyzer::BinOper::common_numeric_type(), Parser::common_string_type(), Analyzer::BinOper::common_string_type(), ddl_utils::alter_column_utils::compare_sql_type_infos(), Catalog_Namespace::Catalog::createTable(), DatumToString(), Analyzer::Expr::decompress(), Analyzer::Constant::do_cast(), generate_column_type(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), anonymous_namespace{Execute.cpp}::get_hpt_overflow_underflow_safe_scaled_values(), get_numeric_scalar_scale(), anonymous_namespace{ExpressionRange.cpp}::getDateTimePrecisionCastRange(), DateTimeTranslator::getDateTruncConstantValue(), DateTimeTranslator::getExtractFromTimeConstantValue(), is_high_precision_timestamp(), 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(), is_numeric_scalar_auto_castable(), operator!=(), StringOps_Namespace::operator<<(), operator=(), operator==(), parse_numeric(), Parser::InsertIntoTableAsSelectStmt::populateData(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), boost::serialization::save(), json_utils::set_value(), StringToDatum(), to_string(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_timestamp_mapping(), and File_Namespace::FileBuffer::writeMetadata().

393 { return dimension; }
int dimension
Definition: sqltypes.h:1270

+ Here is the caller graph for this function:

SQLTypeInfo SQLTypeInfo::get_elem_type ( ) const
inline

Definition at line 975 of file sqltypes.h.

References compression, get_compression(), IS_GEO, kARRAY, kCOLUMN, kCOLUMN_LIST, kDOUBLE, kENCODING_ARRAY, kENCODING_ARRAY_DICT, kENCODING_DICT, kENCODING_GEOINT, kENCODING_NONE, kGEOMETRY, kINT, kNULLT, set_compression(), set_notnull(), set_subtype(), set_type(), setStorageSize(), setUsesFlatBuffer(), subtype, and type.

Referenced by import_export::TypedImportBuffer::add_value(), import_export::TypedImportBuffer::add_values(), anonymous_namespace{TableFunctionCompilationContext.cpp}::alloc_array(), Parser::FunctionRef::analyze(), anonymous_namespace{ResultSetIteration.cpp}::build_array_target_value(), CodeGenerator::codegenArrayBuff(), CodeGenerator::codegenFunctionOperCastArgs(), spatial_type::NPoints::codegenLoads(), spatial_type::NRings::codegenLoads(), spatial_type::NumGeometries::codegenLoads(), ArrayConverterFactory< ELEMENT_FACTORY >::create(), Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::create_array_elem_type_chunk(), foreign_storage::ParquetEncoder::createMetadata(), DateDaysOverflowValidator::DateDaysOverflowValidator(), DecimalOverflowValidator::DecimalOverflowValidator(), Analyzer::Constant::do_cast(), RelAlgExecutor::executeSimpleInsert(), table_functions::anonymous_namespace{TableFunctionsFactory.cpp}::ext_arg_type_to_type_info_output(), get_bit_width(), anonymous_namespace{ExtensionsIR.cpp}::get_llvm_type_from_sql_array_type(), foreign_storage::get_placeholder_metadata(), foreign_storage::Csv::get_placeholder_metadata(), foreign_storage::get_sub_type_column_descriptor(), get_type_name(), getLeafColumnRange(), foreign_storage::TypedParquetInPlaceEncoder< V, V >::getRowGroupMetadata(), foreign_storage::ParquetArrayEncoder::initializeColumnType(), import_export::anonymous_namespace{QueryExporterGDAL.cpp}::insert_array_column(), is_castable(), is_dict_encoded_type(), foreign_storage::ParquetDataWrapper::loadBuffersUsingLazyParquetChunkLoader(), ResultSet::makeVarlenTargetValue(), anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_arguments(), import_export::NullArray(), NullAwareValidator< INNER_VALIDATOR >::NullAwareValidator(), ArraysConverterFactory::operator()(), operator<<(), ChunkMetadata::operator==(), Parser::InsertIntoTableAsSelectStmt::populateData(), ResultSetReductionJIT::reduceOneSlot(), ResultSetStorage::reduceOneSlot(), FixedLengthArrayNoneEncoder::resetChunkStats(), ArrayNoneEncoder::resetChunkStats(), foreign_storage::ParquetFixedLengthArrayEncoder::setNullFixedLengthArraySentinel(), import_export::StringToArray(), import_export::anonymous_namespace{QueryExporterCSV.cpp}::target_value_to_string(), import_export::TDatumToArrayDatum(), to_string(), anonymous_namespace{ColumnarResults.cpp}::toBuffer(), Analyzer::Constant::toString(), ThriftSerializers::type_info_to_thrift(), ExpressionRange::typeSupportsRange(), ddl_utils::validate_and_set_array_size(), ddl_utils::anonymous_namespace{DdlUtils.cpp}::validate_literal(), DBHandler::value_to_thrift(), and DBHandler::value_to_thrift_column().

975  {
976  SQLTypeInfo type_info = *this;
977  if ((type == kCOLUMN || type == kCOLUMN_LIST) && compression == kENCODING_ARRAY) {
978  type_info.set_type(kARRAY);
979  type_info.set_compression(kENCODING_NONE);
980  } else if ((type == kCOLUMN || type == kCOLUMN_LIST) &&
982  type_info.set_type(kARRAY);
983  type_info.set_compression(kENCODING_DICT);
984  } else if ((type == kCOLUMN || type == kCOLUMN_LIST) && IS_GEO(subtype)) {
985  type_info.set_type(subtype);
986  type_info.set_subtype(kGEOMETRY);
987  } else if (IS_GEO(type)) {
988  if (type_info.get_compression() == kENCODING_GEOINT) {
989  type_info.set_type(kINT);
990  type_info.set_compression(kENCODING_NONE);
991  } else {
992  type_info.set_type(kDOUBLE);
993  }
994  type_info.set_subtype(kNULLT);
995  } else if (type == kARRAY) {
996  type_info.set_type(subtype);
997  type_info.set_subtype(kNULLT);
998  type_info.set_notnull(false);
999  type_info.setUsesFlatBuffer(false);
1000  } else {
1001  type_info.set_type(subtype);
1002  type_info.set_subtype(kNULLT);
1003  }
1004  type_info.setStorageSize();
1005  return type_info;
1006  }
void set_compression(EncodingType c)
Definition: sqltypes.h:479
HOST DEVICE void set_subtype(SQLTypes st)
Definition: sqltypes.h:469
SQLTypes subtype
Definition: sqltypes.h:1269
void setStorageSize()
Definition: sqltypes.h:1051
EncodingType compression
Definition: sqltypes.h:1274
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399
void setUsesFlatBuffer(bool uses_flatbuffer=true)
Definition: sqltypes.h:1077
void set_notnull(bool n)
Definition: sqltypes.h:475
SQLTypes type
Definition: sqltypes.h:1268
Definition: sqltypes.h:72
#define IS_GEO(T)
Definition: sqltypes.h:310
HOST DEVICE void set_type(SQLTypes t)
Definition: sqltypes.h:468

+ Here is the call graph for this function:

int SQLTypeInfo::get_logical_size ( ) const
inline

Definition at line 419 of file sqltypes.h.

References compression, dimension, get_size(), kENCODING_DATE_IN_DAYS, kENCODING_DICT, kENCODING_FIXED, kENCODING_NONE, notnull, scale, subtype, and type.

Referenced by CodeGenerator::codegenCastBetweenIntTypes(), CodeGenerator::codegenCastBetweenIntTypesOverflowChecks(), CodeGenerator::codgenAdjustFixedEncNull(), get_agg_initial_val(), get_array_context_logical_size(), get_null_value(), anonymous_namespace{WindowFunctionIR.cpp}::get_null_value_by_size_with_encoding(), get_numeric_scalar_scale(), StorageIOFacility::getRsBufferNoPadding(), inline_int_null_val(), anonymous_namespace{TypedDataAccessors.h}::is_null(), is_numeric_scalar_auto_castable(), is_unsigned_type(), StringDictionaryTranslationMgr::mapSize(), numeric_type_name(), and Fragmenter_Namespace::size_of_raw_column().

419  {
422  return ti.get_size();
423  }
424  if (compression == kENCODING_DICT) {
425  return 4;
426  }
427  return get_size();
428  }
HOST DEVICE int get_size() const
Definition: sqltypes.h:403
SQLTypes subtype
Definition: sqltypes.h:1269
bool notnull
Definition: sqltypes.h:1273
EncodingType compression
Definition: sqltypes.h:1274
SQLTypes type
Definition: sqltypes.h:1268
int dimension
Definition: sqltypes.h:1270

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

HOST DEVICE size_t SQLTypeInfo::get_max_strlen ( ) const
inline

Definition at line 405 of file sqltypes.h.

References compression, and kENCODING_DICT.

Referenced by import_export::TypedImportBuffer::add_value(), foreign_storage::ParquetStringNoneEncoder::appendData(), and ddl_utils::anonymous_namespace{DdlUtils.cpp}::validate_literal().

405  {
406  return compression == kENCODING_DICT
407  ? ~(~size_t(0) << 15) // std::numeric_limits<int16_t>::max()
408  : ~size_t(0); // std::numeric_limits<size_t>::max()
409  }
EncodingType compression
Definition: sqltypes.h:1274

+ Here is the caller graph for this function:

HOST DEVICE bool SQLTypeInfo::get_notnull ( ) const
inline

Definition at line 398 of file sqltypes.h.

References notnull.

Referenced by import_export::TypedImportBuffer::add_arrow_values(), import_export::TypedImportBuffer::add_value(), import_export::TypedImportBuffer::add_values(), Catalog_Namespace::Catalog::addColumn(), Catalog_Namespace::Catalog::addColumnNontransactional(), import_export::TypedImportBuffer::addDefaultValues(), Catalog_Namespace::Catalog::alterColumnTypeTransactional(), Analyzer::BinOper::analyze_type_info(), data_conversion::StringViewToArrayEncoder< ScalarEncoderType >::appendArrayDatums(), foreign_storage::OdbcGeospatialEncoder::appendData(), foreign_storage::TypedParquetInPlaceEncoder< V, V >::appendDataTrackErrors(), anonymous_namespace{ResultSetIteration.cpp}::GeoTargetValueBuilder< GEO_SOURCE_TYPE, GeoTargetFetcher >::build(), ChunkIter_get_nth(), ChunkIter_get_nth_point_coords(), StringDictionaryTranslationMgr::codegen(), CodeGenerator::codegen(), GroupByAndAggregate::codegenApproxQuantile(), CodeGenerator::codegenCast(), CodeGenerator::codegenCastBetweenIntTypes(), CodeGenerator::codegenCastBetweenIntTypesOverflowChecks(), CodeGenerator::codegenCastFromFp(), CodeGenerator::codegenCastNonStringToString(), CodeGenerator::codegenCastToFp(), CodeGenerator::codegenDateTruncHighPrecisionTimestamps(), CodeGenerator::codegenDiv(), CodeGenerator::codegenExtractHighPrecisionTimestamps(), CodeGenerator::codegenGeoArrayLoadAndNullcheck(), GroupByAndAggregate::codegenMode(), Analyzer::BinOper::common_numeric_type(), Analyzer::BinOper::common_string_type(), ddl_utils::alter_column_utils::compare_sql_type_infos(), Geospatial::compress_coords(), anonymous_namespace{RelAlgExecutor.cpp}::anonymous_namespace{RelAlgExecutor.cpp}::conditionally_change_arg_to_int_type(), data_conversion::StringViewToScalarEncoder< DataType, MetadataType >::convertAndUpdateMetadata(), anonymous_namespace{ArrowResultSetConverter.cpp}::create_or_append_validity(), Catalog_Namespace::Catalog::createTable(), Analyzer::Expr::decompress(), Analyzer::InIntegerSet::deep_copy(), Analyzer::Constant::do_cast(), data_conversion::StringViewToStringDictEncoder< IdType >::encodeAndAppendData(), anonymous_namespace{ResultSetIteration.cpp}::GeoLazyFetchHandler::fetch(), anonymous_namespace{ResultSetIteration.cpp}::GeoQueryOutputFetchHandler::fetch(), get_agg_initial_val(), get_null_check_suffix(), target_info::get_target_info_impl(), Fragmenter_Namespace::get_var_len_null_array_indexes(), RelLogicalUnion::getCompatibleMetainfoTypes(), spatial_type::NPoints::getOperand(), Analyzer::anonymous_namespace{Analyzer.cpp}::is_expr_nullable(), FixedLengthArrayNoneEncoder::is_null(), Geospatial::is_null_point(), ResultSet::isNull(), foreign_storage::TextFileBufferParser::isNullDatum(), ArrowResultSetConverter::makeField(), NullAwareValidator< INNER_VALIDATOR >::NullAwareValidator(), operator!=(), operator=(), operator==(), anonymous_namespace{Datum.cpp}::parseInteger(), DBHandler::populateThriftColumnType(), foreign_storage::ParquetArrayEncoder::processLastArray(), anonymous_namespace{TypedDataAccessors.h}::put_null(), anonymous_namespace{TypedDataAccessors.h}::put_null_array(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), Executor::reduceResults(), boost::serialization::save(), GeoTargetValueSerializer< kPOINT >::serialize(), GeoWktSerializer< kPOINT >::serialize(), GeoTargetValuePtrSerializer< kPOINT >::serialize(), GeoTargetValueSerializer< kMULTIPOINT >::serialize(), GeoWktSerializer< kMULTIPOINT >::serialize(), GeoTargetValuePtrSerializer< kMULTIPOINT >::serialize(), GeoTargetValueSerializer< kLINESTRING >::serialize(), GeoWktSerializer< kLINESTRING >::serialize(), GeoTargetValuePtrSerializer< kLINESTRING >::serialize(), GeoTargetValueSerializer< kMULTILINESTRING >::serialize(), GeoWktSerializer< kMULTILINESTRING >::serialize(), GeoTargetValuePtrSerializer< kMULTILINESTRING >::serialize(), GeoTargetValueSerializer< kPOLYGON >::serialize(), GeoWktSerializer< kPOLYGON >::serialize(), GeoTargetValuePtrSerializer< kPOLYGON >::serialize(), GeoTargetValueSerializer< kMULTIPOLYGON >::serialize(), GeoWktSerializer< kMULTIPOLYGON >::serialize(), GeoTargetValuePtrSerializer< kMULTIPOLYGON >::serialize(), Fragmenter_Namespace::set_chunk_stats(), json_utils::set_value(), anonymous_namespace{ResultSetReductionJIT.cpp}::target_info_key(), to_string(), ThriftSerializers::type_info_to_thrift(), Fragmenter_Namespace::anonymous_namespace{UpdelStorage.cpp}::update_metadata(), anonymous_namespace{DdlCommandExecutor.cpp}::validate_alter_type_metadata(), ddl_utils::validate_and_set_sparse_encoding(), foreign_storage::ParquetEncoder::validateNullCount(), DBHandler::value_to_thrift(), DBHandler::value_to_thrift_column(), DeepCopyVisitor::visitInIntegerSet(), and File_Namespace::FileBuffer::writeMetadata().

398 { return notnull; }
bool notnull
Definition: sqltypes.h:1273
int32_t SQLTypeInfo::get_numeric_scalar_scale ( ) const
inline

returns integer between 1 and 8 indicating what is roughly equivalent to the logical byte size of a scalar numeric type (including boolean + time types), but with decimals and numerics mapped to the byte size of their dimension (which may vary from the type width), and timestamps, dates and times handled in a relative fashion. Note: this function only takes the scalar numeric types above, and will throw a check for other types.

Definition at line 822 of file sqltypes.h.

References CHECK, get_dimension(), get_logical_size(), kBIGINT, kBOOLEAN, kDATE, kDECIMAL, kDOUBLE, kFLOAT, kINT, kNUMERIC, kSMALLINT, kTIME, kTIMESTAMP, kTINYINT, type, and UNREACHABLE.

Referenced by anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_numeric_argument().

822  {
823  CHECK(type == kBOOLEAN || type == kTINYINT || type == kSMALLINT || type == kINT ||
824  type == kBIGINT || type == kFLOAT || type == kDOUBLE || type == kDECIMAL ||
825  type == kNUMERIC || type == kTIMESTAMP || type == kDATE || type == kTIME);
826  switch (type) {
827  case kBOOLEAN:
828  return 1;
829  case kTINYINT:
830  case kSMALLINT:
831  case kINT:
832  case kBIGINT:
833  case kFLOAT:
834  case kDOUBLE:
835  return get_logical_size();
836  case kDECIMAL:
837  case kNUMERIC:
838  if (get_dimension() > 7) {
839  return 8;
840  } else {
841  return 4;
842  }
843  case kTIMESTAMP:
844  switch (get_dimension()) {
845  case 9:
846  return 8;
847  case 6:
848  return 4;
849  case 3:
850  return 2;
851  case 0:
852  return 1;
853  default:
854  UNREACHABLE();
855  }
856  case kDATE:
857  return 1;
858  case kTIME:
859  return 1;
860  default:
861  UNREACHABLE();
862  return 0;
863  }
864  }
Definition: sqltypes.h:76
#define UNREACHABLE()
Definition: Logger.h:338
int get_logical_size() const
Definition: sqltypes.h:419
Definition: sqltypes.h:80
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:393
#define CHECK(condition)
Definition: Logger.h:291
SQLTypes type
Definition: sqltypes.h:1268
Definition: sqltypes.h:72

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int SQLTypeInfo::get_physical_cols ( ) const
inline

Definition at line 430 of file sqltypes.h.

References kLINESTRING, kMULTILINESTRING, kMULTIPOINT, kMULTIPOLYGON, kPOINT, kPOLYGON, and type.

Referenced by Catalog_Namespace::Catalog::buildColumnsMapUnlocked(), Parser::DropColumnStmt::execute(), import_export::fill_missing_columns(), get_physical_coord_cols(), foreign_storage::ParquetDataWrapper::loadBuffersUsingLazyParquetChunkLoader(), Catalog_Namespace::Catalog::renameColumn(), foreign_storage::GeospatialEncoder::validateChunksSizing(), and foreign_storage::GeospatialEncoder::validateMetadataSizing().

430  {
431  switch (type) {
432  case kPOINT:
433  return 1; // coords
434  case kMULTIPOINT:
435  return 2; // coords, bounds
436  case kLINESTRING:
437  return 2; // coords, bounds
438  case kMULTILINESTRING:
439  return 3; // coords, linestring_sizes, bounds
440  case kPOLYGON:
441  return 3; // coords, ring_sizes, bounds
442  case kMULTIPOLYGON:
443  return 4; // coords, ring_sizes, poly_rings, bounds
444  default:
445  break;
446  }
447  return 0;
448  }
SQLTypes type
Definition: sqltypes.h:1268

+ Here is the caller graph for this function:

int SQLTypeInfo::get_physical_coord_cols ( ) const
inline

Definition at line 449 of file sqltypes.h.

References get_physical_cols(), and has_bounds().

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(), Analyzer::GeoConstant::makePhysicalConstant(), Analyzer::GeoConstant::physicalCols(), and RelAlgTranslator::translateGeoColumn().

449  {
450  // Return the number of extra columns which need to go through the executor,
451  // as opposed to those which are only needed by CPU. In other words, we omit
452  // any Bounds column.
453  return has_bounds() ? get_physical_cols() - 1 : get_physical_cols();
454  }
int get_physical_cols() const
Definition: sqltypes.h:430
bool has_bounds() const
Definition: sqltypes.h:455

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

HOST DEVICE int SQLTypeInfo::get_scale ( ) const
inline

Definition at line 396 of file sqltypes.h.

References scale.

Referenced by Catalog_Namespace::Catalog::addColumn(), Catalog_Namespace::Catalog::addColumnNontransactional(), Catalog_Namespace::Catalog::alterColumnTypeTransactional(), Analyzer::BinOper::analyze_type_info(), Analyzer::Constant::cast_number(), Executor::castToFP(), CodeGenerator::codegenCastBetweenIntTypes(), CodeGenerator::codegenCastNonStringToString(), CodeGenerator::codegenCastToFp(), CodeGenerator::codegenCmpDecimalConst(), CodeGenerator::codegenDiv(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codgenAdjustFixedEncNull(), Analyzer::BinOper::common_numeric_type(), ddl_utils::alter_column_utils::compare_sql_type_infos(), convert_decimal_value_to_scale(), Catalog_Namespace::Catalog::createTable(), DatumToString(), anonymous_namespace{TypedDataAccessors.h}::decimal_to_double(), DecimalOverflowValidator::DecimalOverflowValidator(), Analyzer::Expr::decompress(), generate_column_type(), anonymous_namespace{ArrowResultSetConverter.cpp}::get_arrow_type(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), getArrowImportType(), anonymous_namespace{RelAlgTranslator.cpp}::makeNumericConstant(), HashJoin::normalizeColumnPair(), operator!=(), StringOps_Namespace::operator<<(), operator=(), operator==(), pair_to_double(), parse_numeric(), Parser::InsertIntoTableAsSelectStmt::populateData(), DBHandler::populateThriftColumnType(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), SegmentTree< INPUT_TYPE, AGG_TYPE >::query(), boost::serialization::save(), anonymous_namespace{ExpressionRange.cpp}::scale_up_interval_endpoint(), json_utils::set_value(), to_string(), 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().

396 { return scale; }

+ Here is the caller graph for this function:

HOST DEVICE int SQLTypeInfo::get_size ( ) const
inline

Definition at line 403 of file sqltypes.h.

References size.

Referenced by import_export::TypedImportBuffer::add_value(), Catalog_Namespace::Catalog::addColumn(), Catalog_Namespace::Catalog::addColumnNontransactional(), import_export::TypedImportBuffer::addDictEncodedString(), Catalog_Namespace::Catalog::alterColumnTypeTransactional(), data_conversion::StringViewToArrayEncoder< ScalarEncoderType >::appendArrayDatums(), ArrayValueConverter< ELEMENT_CONVERTER >::ArrayValueConverter(), Chunk_NS::Chunk::begin_iterator(), WindowFunctionContext::buildAggregationTreeForPartition(), anonymous_namespace{CastIR.cpp}::byte_array_cast(), CodeGenerator::castArrayPointer(), Executor::castToFP(), anonymous_namespace{QueryRewrite.cpp}::check_string_id_overflow(), import_export::TypedImportBuffer::clear(), CodeGenerator::codegenAdd(), CodeGenerator::codegenCast(), Executor::codegenFrameBoundExpr(), CodeGenerator::codegenMul(), CodeGenerator::codegenSub(), CodeGenerator::codgenAdjustFixedEncNull(), ddl_utils::alter_column_utils::compare_sql_type_infos(), WindowFunctionContext::computeNullRangeOfSortedPartition(), anonymous_namespace{RelAlgExecutor.cpp}::anonymous_namespace{RelAlgExecutor.cpp}::conditionally_change_arg_to_int_type(), 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(), RelAlgExecutor::executeSimpleInsert(), Fragmenter_Namespace::FixedLenArrayChunkConverter::FixedLenArrayChunkConverter(), 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(), data_conversion::anonymous_namespace{StringViewSource.h}::get_materialized_string_views(), anonymous_namespace{WindowFunctionIR.cpp}::get_null_value_by_size(), anonymous_namespace{ArrowResultSetConverter.cpp}::get_physical_type(), foreign_storage::get_placeholder_metadata(), foreign_storage::Csv::get_placeholder_metadata(), anonymous_namespace{TypedDataAccessors.h}::get_scalar(), getArrowImportType(), Parser::LocalQueryConnector::getColumnDescriptors(), foreign_storage::TimestampBoundsValidator< T >::getMinMaxBoundsAsStrings(), foreign_storage::IntegralFixedLengthBoundsValidator< T >::getMinMaxBoundsAsStrings(), foreign_storage::BaseDateBoundsValidator< T, is_in_seconds >::getMinMaxBoundsAsStrings(), foreign_storage::FloatPointValidator< T >::getMinMaxBoundsAsStrings(), Chunk_NS::Chunk::getNumElemsForBytesInsertData(), StorageIOFacility::getRsBufferNoPadding(), import_export::TypedImportBuffer::getStringDictBuffer(), inline_fixed_encoding_null_val(), is_unsigned_type(), ColumnFetcher::makeJoinColumn(), import_export::NullArray(), 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(), ArrowForeignStorageBase::replaceNullValues(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::resize_values_buffer(), boost::serialization::save(), json_utils::set_value(), Fragmenter_Namespace::size_of_raw_column(), string_dict_to_int_type(), import_export::StringToArray(), import_export::TDatumToArrayDatum(), to_string(), anonymous_namespace{ColumnarResults.cpp}::toBuffer(), 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(), ddl_utils::anonymous_namespace{DdlUtils.cpp}::validate_literal(), foreign_storage::TimestampBoundsValidator< T >::valueWithinBounds(), foreign_storage::IntegralFixedLengthBoundsValidator< T >::valueWithinBounds(), foreign_storage::BaseDateBoundsValidator< T, is_in_seconds >::valueWithinBounds(), foreign_storage::FloatPointValidator< T >::valueWithinBounds(), ColumnarResults::writeBackCell(), File_Namespace::FileBuffer::writeMetadata(), and import_export::TypedImportBuffer::~TypedImportBuffer().

403 { return size; }
HOST DEVICE int SQLTypeInfo::get_storage_size ( ) const
inlineprivate

Definition at line 1284 of file sqltypes.h.

References comp_param, compression, dimension, kARRAY, kBIGINT, kBOOLEAN, kCHAR, kCOLUMN, kCOLUMN_LIST, kDATE, kDECIMAL, kDOUBLE, kENCODING_DATE_IN_DAYS, kENCODING_DICT, kENCODING_DIFF, kENCODING_FIXED, kENCODING_GEOINT, kENCODING_NONE, kENCODING_RL, kENCODING_SPARSE, kFLOAT, kINT, kINTERVAL_DAY_TIME, kINTERVAL_YEAR_MONTH, kLINESTRING, kMULTILINESTRING, kMULTIPOINT, kMULTIPOLYGON, kNUMERIC, kPOINT, kPOLYGON, kSMALLINT, kTEXT, kTIME, kTIMESTAMP, kTINYINT, kVARCHAR, and type.

Referenced by set_fixed_size(), and setStorageSize().

1284  {
1285  switch (type) {
1286  case kBOOLEAN:
1287  return sizeof(int8_t);
1288  case kTINYINT:
1289  return sizeof(int8_t);
1290  case kSMALLINT:
1291  switch (compression) {
1292  case kENCODING_NONE:
1293  return sizeof(int16_t);
1294  case kENCODING_FIXED:
1295  case kENCODING_SPARSE:
1296  return comp_param / 8;
1297  case kENCODING_RL:
1298  case kENCODING_DIFF:
1299  break;
1300  default:
1301  assert(false);
1302  }
1303  break;
1304  case kINT:
1305  switch (compression) {
1306  case kENCODING_NONE:
1307  return sizeof(int32_t);
1308  case kENCODING_FIXED:
1309  case kENCODING_SPARSE:
1310  case kENCODING_GEOINT:
1311  return comp_param / 8;
1312  case kENCODING_RL:
1313  case kENCODING_DIFF:
1314  break;
1315  default:
1316  assert(false);
1317  }
1318  break;
1319  case kBIGINT:
1320  case kNUMERIC:
1321  case kDECIMAL:
1322  switch (compression) {
1323  case kENCODING_NONE:
1324  return sizeof(int64_t);
1325  case kENCODING_FIXED:
1326  case kENCODING_SPARSE:
1327  return comp_param / 8;
1328  case kENCODING_RL:
1329  case kENCODING_DIFF:
1330  break;
1331  default:
1332  assert(false);
1333  }
1334  break;
1335  case kFLOAT:
1336  switch (compression) {
1337  case kENCODING_NONE:
1338  return sizeof(float);
1339  case kENCODING_FIXED:
1340  case kENCODING_RL:
1341  case kENCODING_DIFF:
1342  case kENCODING_SPARSE:
1343  assert(false);
1344  break;
1345  default:
1346  assert(false);
1347  }
1348  break;
1349  case kDOUBLE:
1350  switch (compression) {
1351  case kENCODING_NONE:
1352  return sizeof(double);
1353  case kENCODING_FIXED:
1354  case kENCODING_RL:
1355  case kENCODING_DIFF:
1356  case kENCODING_SPARSE:
1357  assert(false);
1358  break;
1359  default:
1360  assert(false);
1361  }
1362  break;
1363  case kTIMESTAMP:
1364  case kTIME:
1365  case kINTERVAL_DAY_TIME:
1366  case kINTERVAL_YEAR_MONTH:
1367  case kDATE:
1368  switch (compression) {
1369  case kENCODING_NONE:
1370  return sizeof(int64_t);
1371  case kENCODING_FIXED:
1372  if (type == kTIMESTAMP && dimension > 0) {
1373  assert(false); // disable compression for timestamp precisions
1374  }
1375  return comp_param / 8;
1376  case kENCODING_RL:
1377  case kENCODING_DIFF:
1378  case kENCODING_SPARSE:
1379  assert(false);
1380  break;
1382  switch (comp_param) {
1383  case 0:
1384  return 4; // Default date encoded in days is 32 bits
1385  case 16:
1386  case 32:
1387  return comp_param / 8;
1388  default:
1389  assert(false);
1390  break;
1391  }
1392  default:
1393  assert(false);
1394  }
1395  break;
1396  case kTEXT:
1397  case kVARCHAR:
1398  case kCHAR:
1399  if (compression == kENCODING_DICT) {
1400  return sizeof(int32_t); // @TODO(wei) must check DictDescriptor
1401  }
1402  break;
1403  case kARRAY:
1404  // TODO: return size for fixlen arrays?
1405  break;
1406  case kPOINT:
1407  case kMULTIPOINT:
1408  case kLINESTRING:
1409  case kMULTILINESTRING:
1410  case kPOLYGON:
1411  case kMULTIPOLYGON:
1412  case kCOLUMN:
1413  case kCOLUMN_LIST:
1414  break;
1415  default:
1416  break;
1417  }
1418  return -1;
1419  }
Definition: sqltypes.h:76
EncodingType compression
Definition: sqltypes.h:1274
Definition: sqltypes.h:79
Definition: sqltypes.h:80
Definition: sqltypes.h:68
SQLTypes type
Definition: sqltypes.h:1268
Definition: sqltypes.h:72
int comp_param
Definition: sqltypes.h:1275
int dimension
Definition: sqltypes.h:1270

+ Here is the caller graph for this function:

HOST DEVICE SQLTypes SQLTypeInfo::get_subtype ( ) const
inline

Definition at line 392 of file sqltypes.h.

References subtype.

Referenced by import_export::TypedImportBuffer::add_value(), import_export::TypedImportBuffer::add_values(), Catalog_Namespace::Catalog::addColumn(), Catalog_Namespace::Catalog::addColumnNontransactional(), Catalog_Namespace::Catalog::alterColumnTypeTransactional(), anonymous_namespace{CastIR.cpp}::byte_array_cast(), import_export::TypedImportBuffer::clear(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codgenAdjustFixedEncNull(), ddl_utils::alter_column_utils::compare_sql_type_infos(), Encoder::Create(), Catalog_Namespace::Catalog::createTable(), Analyzer::Expr::decompress(), import_export::fill_missing_columns(), generate_column_type(), anonymous_namespace{ArrowResultSetConverter.cpp}::get_arrow_type(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), get_null_value(), ColumnDescriptor::getDefaultValueLiteral(), getFlatBufferNDimsAndSizes(), import_export::Loader::getStringDict(), has_same_itemtype(), import_export::Importer::importGDALRaster(), import_export::anonymous_namespace{QueryExporterGDAL.cpp}::insert_array_column(), FixedLengthArrayNoneEncoder::is_null_ignore_not_null(), operator!=(), operator=(), operator==(), import_export::TypedImportBuffer::pop_value(), Parser::InsertIntoTableAsSelectStmt::populateData(), DBHandler::populateThriftColumnType(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), foreign_storage::ParquetRowGroupReader::readAndValidateRowGroup(), boost::serialization::save(), json_utils::set_value(), import_export::anonymous_namespace{QueryExporterGDAL.cpp}::sql_type_info_to_ogr_field_type(), RelAlgTranslator::translateArrayFunction(), RelAlgTranslator::translateBinaryGeoFunction(), RelAlgTranslator::translateGeoFunctionArg(), RelAlgTranslator::translateTernaryGeoFunction(), 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_date_encoding(), ddl_utils::validate_and_set_fixed_encoding(), ColumnarResults::writeBackCell(), File_Namespace::FileBuffer::writeMetadata(), and import_export::TypedImportBuffer::~TypedImportBuffer().

392 { return subtype; }
SQLTypes subtype
Definition: sqltypes.h:1269
HOST DEVICE SQLTypes SQLTypeInfo::get_type ( ) const
inline

Definition at line 391 of file sqltypes.h.

References type.

Referenced by import_export::TypedImportBuffer::add_arrow_values(), import_export::TypedImportBuffer::add_value(), import_export::TypedImportBuffer::add_values(), Catalog_Namespace::Catalog::addColumn(), Catalog_Namespace::Catalog::addColumnNontransactional(), import_export::TypedImportBuffer::addDefaultValues(), Catalog_Namespace::Catalog::alterColumnTypeTransactional(), Parser::ArrayLiteral::analyze(), Parser::FunctionRef::analyze(), Analyzer::BinOper::analyze_type_info(), append_datum(), bind_function(), WindowFunctionContext::buildAggregationTreeForPartition(), Executor::canSkipFragmentForFpQual(), Analyzer::Constant::cast_number(), Analyzer::Constant::cast_string(), Analyzer::Constant::cast_to_string(), CodeGenerator::castArrayPointer(), anonymous_namespace{IRCodegen.cpp}::check_valid_join_qual(), import_export::TypedImportBuffer::clear(), StringDictionaryTranslationMgr::codegen(), TargetExprCodegen::codegenAggregate(), CodeGenerator::codegenCast(), CodeGenerator::codegenCastFromFp(), CodeGenerator::codegenCastNonStringToString(), CodeGenerator::codegenCastToFp(), CodeGenerator::codegenCmp(), CodeGenerator::codegenDiv(), CodeGenerator::codegenFunctionOper(), CodeGenerator::codegenGeoArrayLoadAndNullcheck(), CodeGenerator::codegenGeoBinOper(), CodeGenerator::codegenGeoUOper(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codegenIsNullNumber(), Analyzer::BinOper::common_numeric_type(), Analyzer::BinOper::common_string_type(), ddl_utils::alter_column_utils::compare_sql_type_infos(), Geospatial::compress_coords(), WindowFunctionContext::computeNullRangeOfSortedPartition(), anonymous_namespace{RelAlgExecutor.cpp}::anonymous_namespace{RelAlgExecutor.cpp}::conditionally_change_arg_to_int_type(), import_export::TypedImportBuffer::convert_arrow_val_to_import_buffer(), shared::convert_temporal_to_iso_format(), 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_fp_type_from_datum(), extract_int_type_from_datum(), anonymous_namespace{ResultSetIteration.cpp}::GeoLazyFetchHandler::fetch(), anonymous_namespace{ResultSetIteration.cpp}::GeoQueryOutputFetchHandler::fetch(), import_export::fill_missing_columns(), ChunkMetadata::fillChunkStats(), anonymous_namespace{WindowContext.cpp}::fp_comparator_asc(), anonymous_namespace{WindowContext.cpp}::fp_comparator_desc(), anonymous_namespace{ExpressionRange.cpp}::fpRangeFromDecimal(), generate_column_type(), Analyzer::GeoConstant::GeoConstant(), 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(), get_null_value(), anonymous_namespace{WindowFunctionIR.cpp}::get_null_value_by_size(), anonymous_namespace{WindowFunctionIR.cpp}::get_null_value_by_size_with_encoding(), anonymous_namespace{ArrowResultSetConverter.cpp}::get_physical_type(), anonymous_namespace{TypedDataAccessors.h}::get_scalar(), import_export::anonymous_namespace{Importer.cpp}::get_type_for_datum(), anonymous_namespace{Datum.cpp}::get_type_for_datum(), anonymous_namespace{WindowFunctionIR.cpp}::get_window_agg_name(), getArrowImportType(), import_export::TypedImportBuffer::getAsBytes(), EmbeddedDatabase::CursorImpl::getColType(), import_export::TypedImportBuffer::getElementSize(), getExpressionRange(), getFlatBufferNDimsAndSizes(), getFlatBufferSize(), Geospatial::GeoTypesFactory::getGeoColumns(), PerfectJoinHashTable::getHashJoinArgs(), Geospatial::GeoTypesFactory::getNullGeoColumns(), Chunk_NS::Chunk::getNumElemsForBytesInsertData(), StorageIOFacility::getRsBufferNoPadding(), import_export::Loader::getStringDict(), getTargetValueFromFlatBuffer(), Analyzer::ColumnVar::group_predicates(), foreign_storage::GeospatialEncoder::hasBoundsColumn(), foreign_storage::GeospatialEncoder::hasPolyRingsColumn(), foreign_storage::GeospatialEncoder::hasRingOrLineSizesColumn(), import_export::Importer::importGDALRaster(), Chunk_NS::Chunk::initEncoder(), initializeFlatBuffer(), 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(), is_numeric_scalar_auto_castable(), anonymous_namespace{TargetExprBuilder.cpp}::is_varlen_projection(), ChunkMetadata::isPlaceholder(), 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{ExtensionFunctionsBinding.cpp}::match_numeric_argument(), anonymous_namespace{WindowExpressionRewrite.cpp}::matches_gt_bigint_zero(), need_patch_unnest_double(), Parser::CaseExpr::normalize(), HashJoin::normalizeColumnPair(), null_val_bit_pattern(), numeric_type_name(), operator!=(), StringOps_Namespace::operator<<(), operator=(), operator==(), pair_to_double(), foreign_storage::ParquetGeospatialImportEncoder::ParquetGeospatialImportEncoder(), import_export::TypedImportBuffer::pop_value(), populate_TColumn(), Parser::InsertIntoTableAsSelectStmt::populateData(), DBHandler::populateThriftColumnType(), foreign_storage::GeospatialEncoder::processGeoElement(), foreign_storage::TextFileBufferParser::processInvalidGeoColumn(), foreign_storage::GeospatialEncoder::processNullGeoElement(), anonymous_namespace{TypedDataAccessors.h}::put_null(), anonymous_namespace{TypedDataAccessors.h}::put_null_array(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), ArrowForeignStorageBase::read(), ArrowForeignStorageBase::replaceNullValues(), boost::serialization::save(), 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(), json_utils::set_value(), Chunk_NS::Chunk::setChunkBuffer(), Fragmenter_Namespace::size_of_raw_column(), import_export::anonymous_namespace{QueryExporterGDAL.cpp}::sql_type_info_to_ogr_field_type(), StringToDatum(), takes_float_argument(), import_export::TDatumToDatum(), anonymous_namespace{ColumnarResults.cpp}::toBuffer(), Analyzer::Constant::toString(), RexOperator::toString(), RelAlgTranslator::translateBinaryGeoFunction(), RelAlgTranslator::translateGeoBoundingBoxIntersectOper(), RelAlgTranslator::translateGeoColumn(), RelAlgTranslator::translateGeoFunctionArg(), RelAlgTranslator::translateGeoLiteral(), RelAlgTranslator::translateTernaryGeoFunction(), 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(), ddl_utils::anonymous_namespace{DdlUtils.cpp}::validate_literal(), 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(), DBHandler::value_to_thrift(), DBHandler::value_to_thrift_column(), anonymous_namespace{WindowExpressionRewrite.cpp}::window_sum_and_count_match(), ColumnarResults::writeBackCell(), File_Namespace::FileBuffer::writeMetadata(), and import_export::TypedImportBuffer::~TypedImportBuffer().

391 { return type; }
SQLTypes type
Definition: sqltypes.h:1268
std::string SQLTypeInfo::get_type_name ( ) const
inline

Definition at line 482 of file sqltypes.h.

References CHECK_LT, dimension, get_elem_type(), get_output_srid(), IS_GEO, kARRAY, kCOLUMN, kCOLUMN_LIST, kDECIMAL, kNUMERIC, kSQLTYPE_LAST, kTIMESTAMP, scale, size, subtype, to_string(), 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(), Analyzer::GeoConstant::GeoConstant(), get_agg_type(), anonymous_namespace{ArrowResultSetConverter.cpp}::get_arrow_type(), getArrowImportType(), hash_value(), Data_Namespace::AbstractBuffer::initEncoder(), import_export::anonymous_namespace{QueryExporterGDAL.cpp}::insert_array_column(), ResultSet::makeGeoTargetValue(), anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_arguments(), HashJoin::normalizeColumnPair(), operator<<(), pair_to_double(), anonymous_namespace{Datum.cpp}::parseFloatAsInteger(), anonymous_namespace{Datum.cpp}::parseInteger(), Parser::InsertIntoTableAsSelectStmt::populateData(), Fragmenter_Namespace::size_of_raw_column(), import_export::anonymous_namespace{QueryExporterGDAL.cpp}::sql_type_info_to_ogr_field_type(), StringToDatum(), anonymous_namespace{ResultSetReductionJIT.cpp}::target_info_key(), anonymous_namespace{Datum.cpp}::toString(), Analyzer::ColumnVar::toString(), Analyzer::UOper::toString(), RexAgg::toString(), anonymous_namespace{ArrowImporter.h}::type_conversion_error(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_allowed_mapping(), and ScalarExprToSql::visitUOper().

482  {
483  if (IS_GEO(type)) {
484  std::string srid_string = "";
485  if (get_output_srid() > 0) {
486  srid_string = ", " + std::to_string(get_output_srid());
487  }
488  CHECK_LT(static_cast<int>(subtype), kSQLTYPE_LAST);
489  return type_name[static_cast<int>(subtype)] + "(" +
490  type_name[static_cast<int>(type)] + srid_string + ")";
491  }
492  std::string ps = "";
493  if (type == kDECIMAL || type == kNUMERIC) {
494  ps = "(" + std::to_string(dimension) + "," + std::to_string(scale) + ")";
495  } else if (type == kTIMESTAMP) {
496  ps = "(" + std::to_string(dimension) + ")";
497  }
498  if (type == kARRAY) {
499  auto elem_ti = get_elem_type();
500  auto num_elems = (size > 0) ? std::to_string(size / elem_ti.get_size()) : "";
501  CHECK_LT(static_cast<int>(subtype), kSQLTYPE_LAST);
502  return elem_ti.get_type_name() + ps + "[" + num_elems + "]";
503  }
504  if (type == kCOLUMN) {
505  auto elem_ti = get_elem_type();
506  auto num_elems =
507  (size > 0) ? "[" + std::to_string(size / elem_ti.get_size()) + "]" : "";
508  CHECK_LT(static_cast<int>(subtype), kSQLTYPE_LAST);
509  return "COLUMN<" + elem_ti.get_type_name() + ps + ">" + num_elems;
510  }
511  if (type == kCOLUMN_LIST) {
512  auto elem_ti = get_elem_type();
513  auto num_elems =
514  (size > 0) ? "[" + std::to_string(size / elem_ti.get_size()) + "]" : "";
515  CHECK_LT(static_cast<int>(subtype), kSQLTYPE_LAST);
516  return "COLUMN_LIST<" + elem_ti.get_type_name() + ps + ">" + num_elems;
517  }
518  return type_name[static_cast<int>(type)] + ps;
519  }
std::string to_string(char const *&&v)
static std::string type_name[kSQLTYPE_LAST]
Definition: sqltypes.h:1279
SQLTypes subtype
Definition: sqltypes.h:1269
#define CHECK_LT(x, y)
Definition: Logger.h:303
SQLTypes type
Definition: sqltypes.h:1268
SQLTypeInfo get_elem_type() const
Definition: sqltypes.h:975
#define IS_GEO(T)
Definition: sqltypes.h:310
int dimension
Definition: sqltypes.h:1270
HOST DEVICE int get_output_srid() const
Definition: sqltypes.h:397

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const shared::StringDictKey& SQLTypeInfo::getStringDictKey ( ) const
inline

Definition at line 1055 of file sqltypes.h.

References CHECK, comp_param, shared::StringDictKey::dict_id, and dict_key_.

Referenced by Analyzer::Expr::add_cast(), Analyzer::CaseExpr::add_cast(), CodeGenerator::codegenCastFromString(), CodeGenerator::codegenCastNonStringToString(), CodeGenerator::codegenPseudoStringOper(), Parser::common_string_type(), Analyzer::BinOper::common_string_type(), DictionaryConverterFactory< TARGET_TYPE >::create(), DictionaryValueConverter< TARGET_TYPE >::DictionaryValueConverter(), generate_column_type(), Parser::get_str_dict_cast_type(), data_conversion::StringViewSource::getSourceData(), ResultSet::getString(), Analyzer::anonymous_namespace{Analyzer.cpp}::has_same_dict(), ArrowResultSetConverter::initializeColumnBuilder(), Parser::OperExpr::normalize(), TextConverterFactory::operator()(), translate_dict_strings(), ThriftSerializers::type_info_to_thrift(), TransientDictIdVisitor::visitCaseExpr(), TransientDictIdVisitor::visitStringOper(), and TransientDictIdVisitor::visitUOper().

1055  {
1056  // If comp_param is set, it should equal dict_id.
1058  return dict_key_;
1059  }
shared::StringDictKey dict_key_
Definition: sqltypes.h:1282
#define CHECK(condition)
Definition: Logger.h:291
int comp_param
Definition: sqltypes.h:1275

+ Here is the caller graph for this function:

const shared::StringDictKey& SQLTypeInfo::getStringDictKeySkipCompParamCheck ( ) const
inline

Definition at line 1068 of file sqltypes.h.

References dict_key_.

Referenced by json_utils::set_value().

1068  {
1069  return dict_key_;
1070  }
shared::StringDictKey dict_key_
Definition: sqltypes.h:1282

+ Here is the caller graph for this function:

bool SQLTypeInfo::has_bounds ( ) const
inline

Definition at line 455 of file sqltypes.h.

References kLINESTRING, kMULTILINESTRING, kMULTIPOINT, kMULTIPOLYGON, kPOLYGON, and type.

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

455  {
456  switch (type) {
457  case kMULTIPOINT:
458  case kLINESTRING:
459  case kMULTILINESTRING:
460  case kPOLYGON:
461  case kMULTIPOLYGON:
462  return true;
463  default:
464  break;
465  }
466  return false;
467  }
SQLTypes type
Definition: sqltypes.h:1268

+ Here is the caller graph for this function:

bool SQLTypeInfo::has_same_itemtype ( const SQLTypeInfo other) const
inline

Definition at line 662 of file sqltypes.h.

References compression, get_compression(), get_subtype(), is_column(), is_column_list(), kENCODING_ARRAY, kENCODING_ARRAY_DICT, and subtype.

Referenced by bind_function().

662  {
663  if ((is_column() || is_column_list()) &&
664  (other.is_column() || other.is_column_list())) {
665  return subtype == other.get_subtype() &&
667  compression == other.get_compression());
668  }
669  return subtype == other.get_subtype();
670  }
HOST DEVICE SQLTypes get_subtype() const
Definition: sqltypes.h:392
SQLTypes subtype
Definition: sqltypes.h:1269
EncodingType compression
Definition: sqltypes.h:1274
bool is_column() const
Definition: sqltypes.h:598
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399
bool is_column_list() const
Definition: sqltypes.h:601

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<SQLTypes... types>
bool SQLTypeInfo::is_any ( ) const
inline

Definition at line 556 of file sqltypes.h.

References type.

Referenced by ResultSet::convertToScalarTargetValue(), Analyzer::Constant::do_cast(), anonymous_namespace{ExpressionRange.cpp}::getDateTimePrecisionCastRange(), ResultSet::isLessThan(), ResultSet::isNullIval(), and ResultSet::nullScalarTargetValue().

556  {
557  return (... || (types == type));
558  }
SQLTypes type
Definition: sqltypes.h:1268

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_array ( ) const
inline

Definition at line 583 of file sqltypes.h.

References kARRAY, and 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(), DecimalOverflowValidator::DecimalOverflowValidator(), Analyzer::Constant::do_cast(), get_buffer_name(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), foreign_storage::get_placeholder_metadata(), foreign_storage::Csv::get_placeholder_metadata(), Parser::LocalQueryConnector::getColumnDescriptors(), ColumnDescriptor::getDefaultValueLiteral(), getLeafColumnRange(), foreign_storage::TypedParquetInPlaceEncoder< V, V >::getRowGroupMetadata(), ResultSet::getTargetValueFromBufferRowwise(), foreign_storage::TypedParquetInPlaceEncoder< V, V >::getUpdatedStats(), CodeGenerator::hashJoinLhs(), ArrowResultSetConverter::initializeColumnBuilder(), is_buffer(), is_dict_encoded_type(), is_real_str_or_array(), foreign_storage::LazyParquetChunkLoader::isColumnMappingSupported(), Fragmenter_Namespace::isDatumVectorData(), foreign_storage::ParquetDataWrapper::loadBuffersUsingLazyParquetChunkLoader(), ResultSet::makeVarlenTargetValue(), anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_arguments(), CodeGenerator::needCastForHashJoinLhs(), Executor::needLinearizeAllFragments(), null_val_bit_pattern(), NullAwareValidator< INNER_VALIDATOR >::NullAwareValidator(), operator<<(), ChunkMetadata::operator==(), Analyzer::Constant::operator==(), Parser::InsertIntoTableAsSelectStmt::populateData(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), foreign_storage::ParquetRowGroupReader::readAndValidateRowGroup(), Catalog_Namespace::Catalog::setColumnDictionary(), anonymous_namespace{LogicalIR.cpp}::should_defer_eval(), import_export::anonymous_namespace{QueryExporterCSV.cpp}::target_value_to_string(), anonymous_namespace{ColumnarResults.cpp}::toBuffer(), Analyzer::Constant::toString(), ThriftSerializers::type_info_to_thrift(), ExpressionRange::typeSupportsRange(), foreign_storage::update_stats(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_allowed_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_max_repetition_and_definition_level(), DBHandler::value_to_thrift(), DBHandler::value_to_thrift_column(), and ColumnarResults::writeBackCell().

583  {
584  return type == kARRAY;
585  } // Array
SQLTypes type
Definition: sqltypes.h:1268
bool SQLTypeInfo::is_boolean ( ) const
inline

Definition at line 580 of file sqltypes.h.

References kBOOLEAN, and type.

Referenced by Analyzer::BinOper::analyze_type_info(), anonymous_namespace{TableFunctionExecutionContext.cpp}::append_literal_buffer(), WindowFunctionContext::buildAggregationTreeForPartition(), CodeGenerator::castArrayPointer(), CodeGenerator::codegenCast(), CodeGenerator::codegenCmp(), CodeGenerator::codegenHoistedConstantsLoads(), Analyzer::BinOper::common_numeric_type(), WindowFunctionContext::computeNullRangeOfSortedPartition(), anonymous_namespace{ArrowResultSetConverter.cpp}::create_or_append_validity(), Analyzer::Constant::do_cast(), anonymous_namespace{TableFunctionCompilationContext.cpp}::get_llvm_type_from_sql_column_type(), anonymous_namespace{Execute.cpp}::inline_null_val(), anonymous_namespace{RelAlgTranslator.cpp}::is_agg_supported_for_type(), Fragmenter_Namespace::is_integral(), foreign_storage::TypedParquetInPlaceEncoder< V, V >::isIntegralType(), Parser::CaseExpr::normalize(), CodeGenerator::NullCheckCodegen::NullCheckCodegen(), numeric_type_name(), Executor::reduceResults(), ArrowForeignStorageBase::replaceNullValues(), import_export::anonymous_namespace{QueryExporterCSV.cpp}::target_value_to_string(), ExpressionRange::typeSupportsRange(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), and anonymous_namespace{InputMetadata.cpp}::uses_int_meta().

580  {
581  return type == kBOOLEAN;
582  }
SQLTypes type
Definition: sqltypes.h:1268

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_buffer ( ) const
inline

Definition at line 621 of file sqltypes.h.

References is_array(), is_column(), is_column_list(), and is_text_encoding_none().

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

621  {
622  return is_array() || is_column() || is_column_list() || is_text_encoding_none();
623  }
bool is_column() const
Definition: sqltypes.h:598
bool is_column_list() const
Definition: sqltypes.h:601
bool is_text_encoding_none() const
Definition: sqltypes.h:612
bool is_array() const
Definition: sqltypes.h:583

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 713 of file sqltypes.h.

References get_elem_type(), get_type(), is_castable(), is_number(), is_string(), is_time(), kARRAY, kBOOLEAN, kCOLUMN, kCOLUMN_LIST, kDATE, kTIME, kTIMESTAMP, and type.

Referenced by Analyzer::Expr::add_cast(), and is_castable().

713  {
714  // can always cast between the same type but different precision/scale/encodings
715  if (type == new_type_info.get_type()) {
716  return true;
717  // can always cast between strings
718  } else if (is_string() && new_type_info.is_string()) {
719  return true;
720  } else if (is_string() && !new_type_info.is_string()) {
721  return false;
722  } else if (!is_string() && new_type_info.is_string()) {
723  return true;
724  // can cast between numbers
725  } else if (is_number() && new_type_info.is_number()) {
726  return true;
727  // can cast from timestamp or date to number (epoch)
728  } else if ((type == kTIMESTAMP || type == kDATE) && new_type_info.is_number()) {
729  return true;
730  // can cast from number (epoch) to timestamp, date, or time
731  } else if (is_number() && new_type_info.is_time()) {
732  return true;
733  // can cast from date to timestamp
734  } else if (type == kDATE && new_type_info.get_type() == kTIMESTAMP) {
735  return true;
736  } else if (type == kTIMESTAMP && new_type_info.get_type() == kDATE) {
737  return true;
738  } else if (type == kTIMESTAMP && new_type_info.get_type() == kTIME) {
739  return true;
740  } else if (type == kBOOLEAN && new_type_info.is_number()) {
741  return true;
742  } else if (type == kARRAY && new_type_info.get_type() == kARRAY) {
743  return get_elem_type().is_castable(new_type_info.get_elem_type());
744  } else if (type == kCOLUMN && new_type_info.get_type() == kCOLUMN) {
745  return get_elem_type().is_castable(new_type_info.get_elem_type());
746  } else if (type == kCOLUMN_LIST && new_type_info.get_type() == kCOLUMN_LIST) {
747  return get_elem_type().is_castable(new_type_info.get_elem_type());
748  } else {
749  return false;
750  }
751  }
Definition: sqltypes.h:76
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:391
bool is_number() const
Definition: sqltypes.h:574
bool is_time() const
Definition: sqltypes.h:577
bool is_castable(const SQLTypeInfo &new_type_info) const
Definition: sqltypes.h:713
Definition: sqltypes.h:80
SQLTypes type
Definition: sqltypes.h:1268
bool is_string() const
Definition: sqltypes.h:559
SQLTypeInfo get_elem_type() const
Definition: sqltypes.h:975

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_column ( ) const
inline

Definition at line 598 of file sqltypes.h.

References kCOLUMN, and type.

Referenced by get_buffer_name(), has_same_itemtype(), is_buffer(), and DBHandler::value_to_thrift_column().

598  {
599  return type == kCOLUMN;
600  } // Column
SQLTypes type
Definition: sqltypes.h:1268

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_column_array ( ) const
inline

Definition at line 604 of file sqltypes.h.

References get_compression(), kCOLUMN, kENCODING_ARRAY, kENCODING_ARRAY_DICT, and type.

604  {
605  const auto c = get_compression();
606  return type == kCOLUMN && (c == kENCODING_ARRAY || c == kENCODING_ARRAY_DICT);
607  } // ColumnArray
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399
SQLTypes type
Definition: sqltypes.h:1268

+ Here is the call graph for this function:

bool SQLTypeInfo::is_column_list ( ) const
inline

Definition at line 601 of file sqltypes.h.

References kCOLUMN_LIST, and type.

Referenced by has_same_itemtype(), and is_buffer().

601  {
602  return type == kCOLUMN_LIST;
603  } // ColumnList
SQLTypes type
Definition: sqltypes.h:1268

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_column_list_array ( ) const
inline

Definition at line 608 of file sqltypes.h.

References get_compression(), kCOLUMN_LIST, kENCODING_ARRAY, kENCODING_ARRAY_DICT, and type.

608  {
609  const auto c = get_compression();
610  return type == kCOLUMN_LIST && (c == kENCODING_ARRAY || c == kENCODING_ARRAY_DICT);
611  } // ColumnList of ColumnArray
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399
SQLTypes type
Definition: sqltypes.h:1268

+ Here is the call graph for this function:

bool SQLTypeInfo::is_date_in_days ( ) const
inline

Definition at line 1016 of file sqltypes.h.

References get_compression(), kDATE, kENCODING_DATE_IN_DAYS, and type.

Referenced by DateDaysOverflowValidator::DateDaysOverflowValidator(), get_join_column_type_kind(), Parser::LocalQueryConnector::getColumnDescriptors(), ResultSet::makeTargetValue(), and DBHandler::populateThriftColumnType().

1016  {
1017  if (type == kDATE) {
1018  const auto comp_type = get_compression();
1019  if (comp_type == kENCODING_DATE_IN_DAYS) {
1020  return true;
1021  }
1022  }
1023  return false;
1024  }
Definition: sqltypes.h:80
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399
SQLTypes type
Definition: sqltypes.h:1268

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_decimal ( ) const
inline

Definition at line 568 of file sqltypes.h.

References kDECIMAL, kNUMERIC, and type.

Referenced by Analyzer::Constant::add_cast(), import_export::TypedImportBuffer::add_value(), Analyzer::BinOper::analyze_type_info(), anonymous_namespace{RelAlgTranslator.cpp}::build_type_info(), WindowFunctionContext::buildAggregationTreeForPartition(), CodeGenerator::checkExpressionRanges(), CodeGenerator::codegenAdd(), CodeGenerator::codegenCast(), CodeGenerator::codegenCastBetweenIntTypes(), CodeGenerator::codegenCastFromFp(), CodeGenerator::codegenCmp(), CodeGenerator::codegenDiv(), CodeGenerator::codegenFunctionOperWithCustomTypeHandling(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codegenMul(), CodeGenerator::codegenSub(), WindowFunctionContext::computeNullRangeOfSortedPartition(), anonymous_namespace{ArrowResultSetConverter.cpp}::create_or_append_validity(), DecimalOverflowValidator::DecimalOverflowValidator(), extract_int_type_from_datum(), get_bit_width(), import_export::anonymous_namespace{Importer.cpp}::get_type_for_datum(), anonymous_namespace{Datum.cpp}::get_type_for_datum(), data_conversion::StringViewToScalarEncoder< DataType, MetadataType >::initialize(), inline_fixed_encoding_null_val(), foreign_storage::TypedParquetInPlaceEncoder< V, V >::isIntegralType(), ChunkMetadata::isPlaceholder(), HashJoin::normalizeColumnPair(), numeric_type_name(), pair_to_double(), import_export::TypedImportBuffer::pop_value(), Parser::InsertIntoTableAsSelectStmt::populateData(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), SegmentTree< INPUT_TYPE, AGG_TYPE >::query(), Executor::reduceResults(), ddl_utils::set_default_encoding(), import_export::anonymous_namespace{QueryExporterCSV.cpp}::target_value_to_string(), 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().

568  {
569  return type == kDECIMAL || type == kNUMERIC;
570  }
SQLTypes type
Definition: sqltypes.h:1268

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_dict_encoded_string ( ) const
inline

Definition at line 641 of file sqltypes.h.

References compression, is_string(), and kENCODING_DICT.

Referenced by ArrowResultSetConverter::append(), append_datum(), Parser::common_string_type(), Analyzer::BinOper::common_string_type(), anonymous_namespace{ArrowResultSetConverter.cpp}::create_or_append_validity(), anonymous_namespace{DdlCommandExecutor.cpp}::get_alter_column_src_dst_cds(), anonymous_namespace{ArrowResultSetConverter.cpp}::get_arrow_type(), anonymous_namespace{ArrowResultSetConverter.cpp}::get_dict_index_type(), anonymous_namespace{WindowFunctionIR.cpp}::get_null_value_by_size(), import_export::anonymous_namespace{Importer.cpp}::get_type_for_datum(), anonymous_namespace{Datum.cpp}::get_type_for_datum(), RelLogicalUnion::getCompatibleMetainfoTypes(), StorageIOFacility::getRsBufferNoPadding(), ArrowResultSetConverter::initializeColumnBuilder(), is_dict_encoded_type(), foreign_storage::ParquetDataWrapper::loadBuffersUsingLazyParquetChunkLoader(), CodeGenerator::NullCheckCodegen::NullCheckCodegen(), anonymous_namespace{ResultSet.cpp}::IsDictEncodedStr::operator()(), ArrowForeignStorageBase::read(), string_dict_to_int_type(), ArrowForeignStorageBase::tryZeroCopy(), type_info_from_thrift(), and Fragmenter_Namespace::InsertOrderFragmenter::updateChunkStats().

641  {
642  return is_string() && compression == kENCODING_DICT;
643  }
EncodingType compression
Definition: sqltypes.h:1274
bool is_string() const
Definition: sqltypes.h:559

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_dict_encoded_type ( ) const
inline

Definition at line 653 of file sqltypes.h.

References get_elem_type(), is_array(), and is_dict_encoded_string().

Referenced by Catalog_Namespace::Catalog::addToColumnMap(), anonymous_namespace{DdlCommandExecutor.cpp}::get_alter_column_src_dst_cds(), anonymous_namespace{ArrowResultSetConverter.cpp}::get_arrow_type(), ArrowResultSetConverter::initializeColumnBuilder(), Executor::needLinearizeAllFragments(), Catalog_Namespace::Catalog::removeFromColumnMap(), foreign_storage::anonymous_namespace{AbstractTextFileDataWrapper.cpp}::skip_metadata_scan(), and Catalog_Namespace::Catalog::updateInColumnMap().

653  {
654  return is_dict_encoded_string() ||
656  }
bool is_dict_encoded_string() const
Definition: sqltypes.h:641
SQLTypeInfo get_elem_type() const
Definition: sqltypes.h:975
bool is_array() const
Definition: sqltypes.h:583

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_dict_intersection ( ) const
inline

Definition at line 658 of file sqltypes.h.

References dict_intersection.

Referenced by CodeGenerator::codegenCastFromString(), and boost::serialization::save().

658  {
659  return dict_intersection;
660  }
bool dict_intersection
Definition: sqltypes.h:1277

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_encoded_timestamp ( ) const
inline

Definition at line 1047 of file sqltypes.h.

References compression, is_timestamp(), and kENCODING_FIXED.

1047  {
1048  return is_timestamp() && compression == kENCODING_FIXED;
1049  }
bool is_timestamp() const
Definition: sqltypes.h:1044
EncodingType compression
Definition: sqltypes.h:1274

+ Here is the call graph for this function:

bool SQLTypeInfo::is_fixlen_array ( ) const
inline

Definition at line 589 of file sqltypes.h.

References kARRAY, size, and type.

Referenced by data_conversion::StringViewToArrayEncoder< ScalarEncoderType >::appendArrayDatums(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::create_parquet_array_encoder(), Chunk_NS::Chunk::createChunkBuffer(), Chunk_NS::Chunk::getChunkBuffer(), Chunk_NS::Chunk::initEncoder(), is_varlen_indeed(), Chunk_NS::Chunk::isChunkOnDevice(), and Chunk_NS::Chunk::setChunkBuffer().

589  {
590  return type == kARRAY && size > 0;
591  }
SQLTypes type
Definition: sqltypes.h:1268

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_fp ( ) const
inline

Definition at line 571 of file sqltypes.h.

References kDOUBLE, kFLOAT, and type.

Referenced by Analyzer::Constant::add_cast(), anonymous_namespace{TableFunctionExecutionContext.cpp}::append_literal_buffer(), WindowFunctionContext::buildAggregationTreeForPartition(), Executor::castToFP(), CodeGenerator::codegenCastFromFp(), CodeGenerator::codegenCastToFp(), CodeGenerator::codegenDiv(), CodeGenerator::codegenFixedLengthColVarInWindow(), CodeGenerator::codegenIsNullNumber(), WindowFunctionContext::computeNullRangeOfSortedPartition(), 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(), anonymous_namespace{WindowFunctionIR.cpp}::get_null_value_by_size(), anonymous_namespace{WindowFunctionIR.cpp}::get_null_value_by_size_with_encoding(), foreign_storage::FloatPointValidator< T >::getMinMaxBoundsAsStrings(), StorageIOFacility::getRsBufferNoPadding(), inline_fp_null_val(), anonymous_namespace{Execute.cpp}::inline_null_val(), CgenState::inlineFpNull(), CgenState::inlineNull(), is_numeric_scalar_auto_castable(), is_supported_type_for_extern_execution(), need_patch_unnest_double(), null_val_bit_pattern(), CodeGenerator::NullCheckCodegen::NullCheckCodegen(), numeric_type_name(), Executor::reduceResults(), ArrowForeignStorageBase::replaceNullValues(), anonymous_namespace{NativeCodegen.cpp}::set_row_func_argnames(), anonymous_namespace{ColumnarResults.cpp}::toBuffer(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_floating_point_mapping(), foreign_storage::ParquetFixedLengthEncoder< V, T, NullType >::validateIntegralOrFloatingPointMetadata(), foreign_storage::ParquetFixedLengthEncoder< V, T, NullType >::validateIntegralOrFloatingPointValue(), and foreign_storage::FloatPointValidator< T >::valueWithinBounds().

571  {
572  return type == kFLOAT || type == kDOUBLE;
573  }
SQLTypes type
Definition: sqltypes.h:1268

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_geometry ( ) const
inline

Definition at line 595 of file sqltypes.h.

References IS_GEO, and type.

Referenced by Analyzer::GeoOperator::add_cast(), advance_slot(), advance_target_ptr_col_wise(), advance_target_ptr_row_wise(), Parser::InsertStmt::analyze(), Catalog_Namespace::Catalog::buildColumnsMapUnlocked(), TargetExprCodegen::codegen(), GroupByAndAggregate::codegenAggArg(), CodeGenerator::codegenCmp(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codegenHoistedConstantsPlaceholders(), Analyzer::Constant::deep_copy(), Analyzer::Constant::do_cast(), Parser::AddColumnStmt::execute(), import_export::fill_missing_columns(), ColumnDescriptor::getDefaultValueLiteral(), spatial_type::NPoints::getOperand(), 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::ParquetGeospatialImportEncoder::ParquetGeospatialImportEncoder(), Analyzer::GeoConstant::physicalCols(), Parser::InsertIntoTableAsSelectStmt::populateData(), ResultSetReductionJIT::reduceOneSlot(), ResultSetStorage::reduceOneSlot(), ddl_utils::set_default_encoding(), anonymous_namespace{TargetExprBuilder.cpp}::target_has_geo(), anonymous_namespace{ColumnarResults.cpp}::toBuffer(), toLite(), ddl_utils::validate_and_set_compressed_encoding(), ddl_utils::validate_and_set_default_value(), ddl_utils::validate_and_set_none_encoding(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_geospatial_mapping(), DBHandler::value_to_thrift_column(), ColumnarResults::writeBackCell(), and Analyzer::Constant::~Constant().

595  {
596  return IS_GEO(type);
597  }
SQLTypes type
Definition: sqltypes.h:1268
#define IS_GEO(T)
Definition: sqltypes.h:310

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_high_precision_timestamp ( ) const
inline

Definition at line 1034 of file sqltypes.h.

References dimension, get_dimension(), kTIMESTAMP, and 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().

1034  {
1035  if (type == kTIMESTAMP) {
1036  const auto dimension = get_dimension();
1037  if (dimension > 0) {
1038  return true;
1039  }
1040  }
1041  return false;
1042  }
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:393
SQLTypes type
Definition: sqltypes.h:1268
int dimension
Definition: sqltypes.h:1270

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_integer ( ) const
inline

Definition at line 565 of file sqltypes.h.

References IS_INTEGER, and type.

Referenced by Analyzer::Constant::add_cast(), Parser::FunctionRef::analyze(), Analyzer::BinOper::analyze_type_info(), anonymous_namespace{TableFunctionExecutionContext.cpp}::append_literal_buffer(), WindowFunctionContext::buildAggregationTreeForPartition(), CodeGenerator::castArrayPointer(), CodeGenerator::codegenAdd(), CodeGenerator::codegenCast(), CodeGenerator::codegenCastBetweenIntTypes(), CodeGenerator::codegenCastFromFp(), CodeGenerator::codegenCmp(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codegenMod(), CodeGenerator::codegenMul(), CodeGenerator::codegenSub(), WindowFunctionContext::computeNullRangeOfSortedPartition(), NumericConverterFactory< SOURCE_TYPE, TARGET_TYPE >::create(), anonymous_namespace{ArrowResultSetConverter.cpp}::create_or_append_validity(), 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(), foreign_storage::TypedParquetInPlaceEncoder< V, V >::isIntegralType(), HashJoin::normalizeColumnPair(), numeric_type_name(), pair_to_double(), Parser::InsertIntoTableAsSelectStmt::populateData(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), Executor::reduceResults(), ArrowForeignStorageBase::replaceNullValues(), anonymous_namespace{InputMetadata.cpp}::uses_int_meta(), foreign_storage::ParquetUnsignedFixedLengthEncoder< V, T, U, NullType >::validate(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_integral_mapping(), foreign_storage::ParquetFixedLengthEncoder< V, T, NullType >::validateIntegralOrFloatingPointMetadata(), foreign_storage::ParquetFixedLengthEncoder< V, T, NullType >::validateIntegralOrFloatingPointValue(), and foreign_storage::IntegralFixedLengthBoundsValidator< T >::valueWithinBounds().

565  {
566  return IS_INTEGER(type);
567  }
#define IS_INTEGER(T)
Definition: sqltypes.h:304
SQLTypes type
Definition: sqltypes.h:1268

+ Here is the caller graph for this function:

int SQLTypeInfo::is_logical_geo_type ( ) const
inline

Definition at line 411 of file sqltypes.h.

References kLINESTRING, kMULTILINESTRING, kMULTIPOINT, kMULTIPOLYGON, kPOINT, kPOLYGON, and type.

411  {
412  if (type == kPOINT || type == kLINESTRING || type == kMULTILINESTRING ||
413  type == kMULTIPOINT || type == kPOLYGON || type == kMULTIPOLYGON) {
414  return true;
415  }
416  return false;
417  }
SQLTypes type
Definition: sqltypes.h:1268
bool SQLTypeInfo::is_none_encoded_string ( ) const
inline

Definition at line 645 of file sqltypes.h.

References compression, is_string(), and kENCODING_NONE.

Referenced by Parser::common_string_type(), data_conversion::StringViewToScalarEncoder< DataType, MetadataType >::convert(), and anonymous_namespace{RelAlgExecutor.cpp}::is_none_encoded_text().

645  {
646  return is_string() && compression == kENCODING_NONE;
647  }
EncodingType compression
Definition: sqltypes.h:1274
bool is_string() const
Definition: sqltypes.h:559

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 866 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 type.

Referenced by ChunkIter_get_next(), ChunkIter_get_nth(), decompress(), and StringOps_Namespace::StringOpInfo::isLiteralArgNull().

866  {
867  // assuming Datum is always uncompressed
868  switch (type) {
869  case kBOOLEAN:
870  return (int8_t)d.boolval == NULL_BOOLEAN;
871  case kTINYINT:
872  return d.tinyintval == NULL_TINYINT;
873  case kSMALLINT:
874  return d.smallintval == NULL_SMALLINT;
875  case kINT:
876  return d.intval == NULL_INT;
877  case kBIGINT:
878  case kNUMERIC:
879  case kDECIMAL:
880  return d.bigintval == NULL_BIGINT;
881  case kFLOAT:
882  return d.floatval == NULL_FLOAT;
883  case kDOUBLE:
884  return d.doubleval == NULL_DOUBLE;
885  case kTIME:
886  case kTIMESTAMP:
887  case kDATE:
888  return d.bigintval == NULL_BIGINT;
889  case kTEXT:
890  case kVARCHAR:
891  case kCHAR:
892  // @TODO handle null strings
893  break;
894  case kNULLT:
895  return true;
896  case kARRAY:
897  return d.arrayval == NULL || d.arrayval->is_null;
898  default:
899  break;
900  }
901  return false;
902  }
int8_t tinyintval
Definition: Datum.h:71
#define NULL_DOUBLE
Definition: sqltypes.h:76
#define NULL_FLOAT
bool is_null
Definition: Datum.h:57
#define NULL_BIGINT
int8_t boolval
Definition: Datum.h:70
VarlenDatum * arrayval
Definition: Datum.h:77
int32_t intval
Definition: Datum.h:73
#define NULL_INT
float floatval
Definition: Datum.h:75
int64_t bigintval
Definition: Datum.h:74
int16_t smallintval
Definition: Datum.h:72
#define NULL_BOOLEAN
Definition: sqltypes.h:79
Definition: sqltypes.h:80
Definition: sqltypes.h:68
#define NULL_TINYINT
SQLTypes type
Definition: sqltypes.h:1268
#define NULL_SMALLINT
Definition: sqltypes.h:72
double doubleval
Definition: Datum.h:76

+ Here is the caller graph for this function:

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

Definition at line 903 of file sqltypes.h.

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

903  {
904  if (type == kFLOAT) {
905  return *(float*)val == NULL_FLOAT;
906  }
907  if (type == kDOUBLE) {
908  return *(double*)val == NULL_DOUBLE;
909  }
910  // val can be either compressed or uncompressed
911  switch (size) {
912  case 1:
913  return *val == NULL_TINYINT;
914  case 2:
915  return *(int16_t*)val == NULL_SMALLINT;
916  case 4:
917  return *(int32_t*)val == NULL_INT;
918  case 8:
919  return *(int64_t*)val == NULL_BIGINT;
920  case kNULLT:
921  return true;
922  default:
923  // @TODO(wei) handle null strings
924  break;
925  }
926  return false;
927  }
#define NULL_DOUBLE
#define NULL_FLOAT
#define NULL_BIGINT
#define NULL_INT
#define NULL_TINYINT
SQLTypes type
Definition: sqltypes.h:1268
#define NULL_SMALLINT
HOST DEVICE bool SQLTypeInfo::is_null_fixlen_array ( const int8_t *  val,
int  array_size 
) const
inline

Definition at line 928 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, size, subtype, and type.

Referenced by ChunkIter_get_nth().

928  {
929  // Check if fixed length array has a NULL_ARRAY sentinel as the first element
930  if (type == kARRAY && val && array_size > 0 && array_size == size) {
931  // Need to create element type to get the size, but can't call get_elem_type()
932  // since this is a HOST DEVICE function. Going through copy constructor instead.
933  auto elem_ti{*this};
934  elem_ti.set_type(subtype);
935  elem_ti.set_subtype(kNULLT);
936  auto elem_size = elem_ti.get_storage_size();
937  if (elem_size < 1) {
938  return false;
939  }
940  if (subtype == kFLOAT) {
941  return *(float*)val == NULL_ARRAY_FLOAT;
942  }
943  if (subtype == kDOUBLE) {
944  return *(double*)val == NULL_ARRAY_DOUBLE;
945  }
946  switch (elem_size) {
947  case 1:
948  return *val == NULL_ARRAY_TINYINT;
949  case 2:
950  return *(int16_t*)val == NULL_ARRAY_SMALLINT;
951  case 4:
952  return *(int32_t*)val == NULL_ARRAY_INT;
953  case 8:
954  return *(int64_t*)val == NULL_ARRAY_BIGINT;
955  default:
956  return false;
957  }
958  }
959  return false;
960  }
#define NULL_ARRAY_INT
#define NULL_ARRAY_SMALLINT
#define NULL_ARRAY_TINYINT
SQLTypes subtype
Definition: sqltypes.h:1269
#define NULL_ARRAY_FLOAT
#define NULL_ARRAY_DOUBLE
SQLTypes type
Definition: sqltypes.h:1268
#define NULL_ARRAY_BIGINT

+ Here is the caller graph for this function:

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

Definition at line 961 of file sqltypes.h.

References kARRAY, kTINYINT, NULL_ARRAY_COMPRESSED_32, NULL_ARRAY_DOUBLE, size, subtype, and type.

Referenced by ChunkIter_get_nth_point_coords().

962  {
963  if (type == kARRAY && subtype == kTINYINT && val && array_size > 0 &&
964  array_size == size) {
965  if (array_size == 2 * sizeof(double)) {
966  return *(double*)val == NULL_ARRAY_DOUBLE;
967  }
968  if (array_size == 2 * sizeof(int32_t)) {
969  return *(uint32_t*)val == NULL_ARRAY_COMPRESSED_32;
970  }
971  }
972  return false;
973  }
#define NULL_ARRAY_COMPRESSED_32
SQLTypes subtype
Definition: sqltypes.h:1269
#define NULL_ARRAY_DOUBLE
SQLTypes type
Definition: sqltypes.h:1268

+ Here is the caller graph for this function:

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

returns true if the sql_type can be cast to the type specified by new_type_info with no loss of precision. Currently only used in ExtensionFunctionsBindings to determine legal function matches, but we should consider whether we need to rationalize implicit casting behavior more broadly in QueryEngine.

Definition at line 761 of file sqltypes.h.

References get_dimension(), get_logical_size(), get_type(), is_fp(), is_number(), kBIGINT, kBOOLEAN, kDATE, kDECIMAL, kDOUBLE, kFLOAT, kINT, kNUMERIC, kSMALLINT, kTIME, kTIMESTAMP, kTINYINT, type, and UNREACHABLE.

Referenced by anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_numeric_argument().

761  {
762  const auto& new_type = new_type_info.get_type();
763  switch (type) {
764  case kBOOLEAN:
765  return new_type == kBOOLEAN;
766  case kTINYINT:
767  case kSMALLINT:
768  case kINT:
769  if (!new_type_info.is_number()) {
770  return false;
771  }
772  if (new_type_info.is_fp()) {
773  // We can lose precision here, but preserving existing behavior
774  return true;
775  }
776  return new_type_info.get_logical_size() >= get_logical_size();
777  case kBIGINT:
778  return new_type == kBIGINT || new_type == kDOUBLE || new_type == kFLOAT;
779  case kFLOAT:
780  case kDOUBLE:
781  if (!new_type_info.is_fp()) {
782  return false;
783  }
784  return (new_type_info.get_logical_size() >= get_logical_size());
785  case kDECIMAL:
786  case kNUMERIC:
787  switch (new_type) {
788  case kDECIMAL:
789  case kNUMERIC:
790  return new_type_info.get_dimension() >= get_dimension();
791  case kDOUBLE:
792  return true;
793  case kFLOAT:
794  return get_dimension() <= 7;
795  default:
796  return false;
797  }
798  case kTIMESTAMP:
799  if (new_type != kTIMESTAMP) {
800  return false;
801  }
802  return new_type_info.get_dimension() >= get_dimension();
803  case kDATE:
804  return new_type == kDATE;
805  case kTIME:
806  return new_type == kTIME;
807  default:
808  UNREACHABLE();
809  return false;
810  }
811  }
Definition: sqltypes.h:76
bool is_fp() const
Definition: sqltypes.h:571
#define UNREACHABLE()
Definition: Logger.h:338
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:391
bool is_number() const
Definition: sqltypes.h:574
int get_logical_size() const
Definition: sqltypes.h:419
Definition: sqltypes.h:80
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:393
SQLTypes type
Definition: sqltypes.h:1268
Definition: sqltypes.h:72

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_string ( ) const
inline

Definition at line 559 of file sqltypes.h.

References IS_STRING, and type.

Referenced by Analyzer::Expr::add_cast(), Analyzer::UOper::add_cast(), Analyzer::CaseExpr::add_cast(), Analyzer::GeoOperator::add_cast(), anonymous_namespace{TableFunctionCompilationContext.cpp}::alloc_column(), anonymous_namespace{TableFunctionCompilationContext.cpp}::alloc_column_list(), Parser::InValues::analyze(), Parser::FunctionRef::analyze(), Parser::QuerySpec::analyze_group_by(), Analyzer::BinOper::analyze_type_info(), CodeGenerator::castArrayPointer(), CodeGenerator::codegenCast(), CodeGenerator::codegenCastFromString(), CodeGenerator::codegenCastNonStringToString(), CodeGenerator::codegenCmp(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codegenHoistedConstantsPlaceholders(), Parser::common_string_type(), Analyzer::BinOper::common_string_type(), ResultSet::convertToScalarTargetValue(), 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::delDictionaryNontransactional(), Analyzer::Constant::do_cast(), RelAlgExecutor::executeSimpleInsert(), get_agg_initial_val(), get_array_context_logical_size(), import_export::TypedImportBuffer::get_data_block_pointers(), anonymous_namespace{TargetExprBuilder.cpp}::get_initial_agg_val(), anonymous_namespace{TableFunctionCompilationContext.cpp}::get_llvm_type_from_sql_column_type(), Parser::get_str_dict_cast_type(), PerfectJoinHashTable::getAlternativeCacheKey(), Catalog_Namespace::Catalog::getColumnDictDirectory(), ColumnDescriptor::getDefaultValueLiteral(), 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(), anonymous_namespace{RelAlgTranslator.cpp}::is_agg_supported_for_type(), is_castable(), is_dict_encoded_string(), is_none_encoded_string(), is_real_str_or_array(), is_supported_type_for_extern_execution(), ResultSet::isLessThan(), foreign_storage::TextFileBufferParser::isNullDatum(), ResultSet::isNullIval(), Fragmenter_Namespace::isStringVectorData(), ResultSet::makeVarlenTargetValue(), CodeGenerator::needCastForHashJoinLhs(), Executor::needLinearizeAllFragments(), Parser::CaseExpr::normalize(), HashJoin::normalizeColumnPair(), null_val_bit_pattern(), ResultSet::nullScalarTargetValue(), 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(), anonymous_namespace{DdlCommandExecutor.cpp}::validate_alter_type_allowed(), ddl_utils::validate_and_set_dictionary_encoding(), ddl_utils::validate_and_set_none_encoding(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_string_mapping(), TransientStringLiteralsVisitor::visitConstant(), TransientStringLiteralsVisitor::visitStringOper(), StorageIOFacility::yieldUpdateCallback(), and Analyzer::Constant::~Constant().

559  {
560  return IS_STRING(type);
561  }
#define IS_STRING(T)
Definition: sqltypes.h:309
SQLTypes type
Definition: sqltypes.h:1268
bool SQLTypeInfo::is_string_array ( ) const
inline

Definition at line 562 of file sqltypes.h.

References IS_STRING, kARRAY, subtype, and type.

Referenced by Catalog_Namespace::Catalog::delDictionaryNontransactional(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), Catalog_Namespace::Catalog::getColumnDictDirectory(), ColumnDescriptor::getDefaultValueLiteral(), 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().

562  {
563  return (type == kARRAY) && IS_STRING(subtype);
564  }
SQLTypes subtype
Definition: sqltypes.h:1269
#define IS_STRING(T)
Definition: sqltypes.h:309
SQLTypes type
Definition: sqltypes.h:1268

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_subtype_dict_encoded_string ( ) const
inline

Definition at line 649 of file sqltypes.h.

References compression, IS_STRING, kENCODING_DICT, and subtype.

Referenced by type_info_from_thrift().

649  {
651  }
SQLTypes subtype
Definition: sqltypes.h:1269
EncodingType compression
Definition: sqltypes.h:1274
#define IS_STRING(T)
Definition: sqltypes.h:309

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_text_encoding_dict ( ) const
inline

Definition at line 615 of file sqltypes.h.

References get_compression(), kENCODING_DICT, kTEXT, and type.

Referenced by Analyzer::Expr::add_cast(), Analyzer::GeoOperator::add_cast(), and CodeGenerator::codegenCast().

615  {
616  return type == kTEXT && get_compression() == kENCODING_DICT;
617  }
Definition: sqltypes.h:79
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399
SQLTypes type
Definition: sqltypes.h:1268

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_text_encoding_dict_array ( ) const
inline

Definition at line 618 of file sqltypes.h.

References get_compression(), kARRAY, kENCODING_DICT, kTEXT, subtype, and type.

618  {
619  return type == kARRAY && subtype == kTEXT && get_compression() == kENCODING_DICT;
620  }
SQLTypes subtype
Definition: sqltypes.h:1269
Definition: sqltypes.h:79
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399
SQLTypes type
Definition: sqltypes.h:1268

+ Here is the call graph for this function:

bool SQLTypeInfo::is_text_encoding_none ( ) const
inline

Definition at line 612 of file sqltypes.h.

References get_compression(), kENCODING_NONE, kTEXT, and type.

Referenced by anonymous_namespace{TableFunctionExecutionContext.cpp}::append_literal_buffer(), get_buffer_name(), anonymous_namespace{ExtensionsIR.cpp}::get_llvm_type_from_sql_array_type(), anonymous_namespace{TableFunctionCompilationContext.cpp}::get_llvm_type_from_sql_column_type(), is_buffer(), and ColumnarResults::writeBackCell().

612  {
613  return type == kTEXT && get_compression() == kENCODING_NONE;
614  }
Definition: sqltypes.h:79
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399
SQLTypes type
Definition: sqltypes.h:1268

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_time ( ) const
inline

Definition at line 577 of file sqltypes.h.

References is_datetime(), and type.

Referenced by Analyzer::Expr::add_cast(), Analyzer::Constant::add_cast(), Analyzer::BinOper::analyze_type_info(), CodeGenerator::codegenCast(), CodeGenerator::codegenCmp(), CodeGenerator::codegenHoistedConstantsLoads(), anonymous_namespace{ArrowResultSetConverter.cpp}::create_or_append_validity(), Analyzer::Constant::do_cast(), ColumnDescriptor::getDefaultValueLiteral(), inline_fixed_encoding_null_val(), anonymous_namespace{Execute.cpp}::inline_null_val(), import_export::anonymous_namespace{QueryExporterGDAL.cpp}::insert_array_column(), import_export::anonymous_namespace{QueryExporterGDAL.cpp}::insert_scalar_column(), anonymous_namespace{RelAlgTranslator.cpp}::is_agg_supported_for_type(), is_castable(), Fragmenter_Namespace::is_integral(), foreign_storage::TypedParquetInPlaceEncoder< V, V >::isIntegralType(), HashJoin::normalizeColumnPair(), CodeGenerator::NullCheckCodegen::NullCheckCodegen(), numeric_type_name(), Parser::InsertIntoTableAsSelectStmt::populateData(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), Executor::reduceResults(), import_export::StringToArray(), import_export::anonymous_namespace{QueryExporterCSV.cpp}::target_value_to_string(), ExpressionRange::typeSupportsRange(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), and anonymous_namespace{InputMetadata.cpp}::uses_int_meta().

577  {
578  return is_datetime(type);
579  }
SQLTypes type
Definition: sqltypes.h:1268
constexpr auto is_datetime(SQLTypes type)
Definition: sqltypes.h:325

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_time_or_date ( ) const
inline

Definition at line 1030 of file sqltypes.h.

References kDATE, kTIME, kTIMESTAMP, and type.

Referenced by WindowFunctionContext::buildAggregationTreeForPartition(), and WindowFunctionContext::computeNullRangeOfSortedPartition().

1030  {
1031  return type == kDATE || type == kTIME || type == kTIMESTAMP;
1032  }
Definition: sqltypes.h:76
Definition: sqltypes.h:80
SQLTypes type
Definition: sqltypes.h:1268

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_varlen ( ) const
inline
bool SQLTypeInfo::is_varlen_array ( ) const
inline

Definition at line 586 of file sqltypes.h.

References kARRAY, size, and type.

Referenced by data_conversion::StringViewToArrayEncoder< ScalarEncoderType >::appendArrayDatums(), and Fragmenter_Namespace::get_var_len_null_array_indexes().

586  {
587  return type == kARRAY && size <= 0;
588  }
SQLTypes type
Definition: sqltypes.h:1268

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_varlen_indeed ( ) const
inline

Definition at line 635 of file sqltypes.h.

References is_fixlen_array(), and is_varlen().

Referenced by foreign_storage::anonymous_namespace{AbstractTextFileDataWrapper.cpp}::add_placeholder_metadata(), foreign_storage::cache_blocks(), Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::BaseAlterColumnContext::createChunkScratchBuffer(), Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::BaseAlterColumnContext::freeChunkScratchBuffer(), foreign_storage::get_placeholder_metadata(), and foreign_storage::Csv::get_placeholder_metadata().

635  {
636  // SQLTypeInfo.is_varlen() is broken with fixedlen array now
637  // and seems left broken for some concern, so fix it locally
638  return is_varlen() && !is_fixlen_array();
639  }
bool is_varlen() const
Definition: sqltypes.h:629
bool is_fixlen_array() const
Definition: sqltypes.h:589

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 672 of file sqltypes.h.

References comp_param, compression, dict_key_, dimension, get_comp_param(), get_compression(), get_dimension(), get_notnull(), get_scale(), get_subtype(), get_type(), kENCODING_NONE, notnull, scale, subtype, TRANSIENT_DICT, and type.

672  {
673  return type != rhs.get_type() || subtype != rhs.get_subtype() ||
674  dimension != rhs.get_dimension() || scale != rhs.get_scale() ||
675  compression != rhs.get_compression() ||
678  notnull != rhs.get_notnull() || dict_key_ != rhs.dict_key_;
679  }
HOST DEVICE SQLTypes get_subtype() const
Definition: sqltypes.h:392
shared::StringDictKey dict_key_
Definition: sqltypes.h:1282
HOST DEVICE int get_scale() const
Definition: sqltypes.h:396
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:391
SQLTypes subtype
Definition: sqltypes.h:1269
bool notnull
Definition: sqltypes.h:1273
EncodingType compression
Definition: sqltypes.h:1274
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:393
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:402
SQLTypes type
Definition: sqltypes.h:1268
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:398
#define TRANSIENT_DICT(ID)
Definition: sqltypes.h:322
int comp_param
Definition: sqltypes.h:1275
int dimension
Definition: sqltypes.h:1270

+ Here is the call graph for this function:

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

Definition at line 700 of file sqltypes.h.

References comp_param, compression, dict_key_, dimension, get_comp_param(), get_compression(), get_dimension(), get_notnull(), get_scale(), get_size(), get_subtype(), get_type(), notnull, scale, size, subtype, type, and uses_flatbuffer_.

700  {
701  type = rhs.get_type();
702  subtype = rhs.get_subtype();
703  dimension = rhs.get_dimension();
704  scale = rhs.get_scale();
705  notnull = rhs.get_notnull();
707  comp_param = rhs.get_comp_param();
708  size = rhs.get_size();
709  dict_key_ = rhs.dict_key_;
711  }
HOST DEVICE SQLTypes get_subtype() const
Definition: sqltypes.h:392
HOST DEVICE int get_size() const
Definition: sqltypes.h:403
shared::StringDictKey dict_key_
Definition: sqltypes.h:1282
HOST DEVICE int get_scale() const
Definition: sqltypes.h:396
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:391
SQLTypes subtype
Definition: sqltypes.h:1269
bool notnull
Definition: sqltypes.h:1273
EncodingType compression
Definition: sqltypes.h:1274
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399
bool uses_flatbuffer_
Definition: sqltypes.h:1283
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:393
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:402
SQLTypes type
Definition: sqltypes.h:1268
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:398
int comp_param
Definition: sqltypes.h:1275
int dimension
Definition: sqltypes.h:1270

+ Here is the call graph for this function:

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

Definition at line 680 of file sqltypes.h.

References comp_param, compression, dict_key_, dimension, get_comp_param(), get_compression(), get_dimension(), get_notnull(), get_scale(), get_subtype(), get_type(), kENCODING_NONE, notnull, scale, subtype, TRANSIENT_DICT, and type.

680  {
681  return type == rhs.get_type() && subtype == rhs.get_subtype() &&
682  dimension == rhs.get_dimension() && scale == rhs.get_scale() &&
683  compression == rhs.get_compression() &&
686  notnull == rhs.get_notnull() && dict_key_ == rhs.dict_key_;
687  }
HOST DEVICE SQLTypes get_subtype() const
Definition: sqltypes.h:392
shared::StringDictKey dict_key_
Definition: sqltypes.h:1282
HOST DEVICE int get_scale() const
Definition: sqltypes.h:396
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:391
SQLTypes subtype
Definition: sqltypes.h:1269
bool notnull
Definition: sqltypes.h:1273
EncodingType compression
Definition: sqltypes.h:1274
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:393
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:402
SQLTypes type
Definition: sqltypes.h:1268
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:398
#define TRANSIENT_DICT(ID)
Definition: sqltypes.h:322
int comp_param
Definition: sqltypes.h:1275
int dimension
Definition: sqltypes.h:1270

+ Here is the call graph for this function:

void SQLTypeInfo::set_comp_param ( int  p)
inline

Definition at line 480 of file sqltypes.h.

References comp_param.

Referenced by Analyzer::CaseExpr::add_cast(), Parser::QuerySpec::analyze_group_by(), Catalog_Namespace::Catalog::buildColumnsMapUnlocked(), Geospatial::convert_coords(), Catalog_Namespace::Catalog::createTable(), import_export::Importer::gdalToColumnDescriptorsGeo(), import_export::Importer::gdalToColumnDescriptorsRaster(), anonymous_namespace{DdlCommandExecutor.cpp}::get_alter_column_src_dst_cds(), json_utils::get_value(), Parser::LocalQueryConnector::getColumnDescriptors(), boost::serialization::load(), Analyzer::anonymous_namespace{Analyzer.cpp}::make_transient_dict_type(), Parser::OperExpr::normalize(), import_export::parse_add_metadata_columns(), File_Namespace::FileBuffer::readMetadata(), ddl_utils::set_default_encoding(), Catalog_Namespace::Catalog::setColumnDictionary(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::suggest_string_mapping(), RelAlgTranslator::translateBinaryGeoConstructor(), RelAlgTranslator::translateGeoFunctionArg(), RelAlgTranslator::translateGeoLiteral(), RelAlgTranslator::translateUnaryGeoConstructor(), RelAlgTranslator::translateUoper(), ddl_utils::validate_and_set_compressed_encoding(), ddl_utils::validate_and_set_date_encoding(), 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(), and ddl_utils::validate_and_set_sparse_encoding().

480 { comp_param = p; }
int comp_param
Definition: sqltypes.h:1275

+ Here is the caller graph for this function:

void SQLTypeInfo::set_compression ( EncodingType  c)
inline

Definition at line 479 of file sqltypes.h.

References compression.

Referenced by Analyzer::Constant::add_cast(), Parser::QuerySpec::analyze_group_by(), Catalog_Namespace::Catalog::buildColumnsMapUnlocked(), Geospatial::convert_coords(), import_export::Importer::gdalToColumnDescriptorsGeo(), import_export::Importer::gdalToColumnDescriptorsRaster(), get_elem_type(), get_logical_type_info(), json_utils::get_value(), Parser::LocalQueryConnector::getColumnDescriptors(), boost::serialization::load(), Analyzer::anonymous_namespace{Analyzer.cpp}::make_transient_dict_type(), Parser::OperExpr::normalize(), import_export::parse_add_metadata_columns(), File_Namespace::FileBuffer::readMetadata(), ddl_utils::set_default_encoding(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::suggest_boolean_type_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::suggest_decimal_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::suggest_floating_point_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::suggest_integral_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::suggest_string_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::suggest_timestamp_mapping(), RelAlgTranslator::translateBinaryGeoConstructor(), RelAlgTranslator::translateGeoFunctionArg(), RelAlgTranslator::translateGeoLiteral(), RelAlgTranslator::translateUnaryGeoConstructor(), RelAlgTranslator::translateUoper(), ddl_utils::validate_and_set_compressed_encoding(), ddl_utils::validate_and_set_date_encoding(), 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(), and ddl_utils::validate_and_set_sparse_encoding().

479 { compression = c; }
EncodingType compression
Definition: sqltypes.h:1274

+ Here is the caller graph for this function:

void SQLTypeInfo::set_dict_intersection ( )
inline

Definition at line 478 of file sqltypes.h.

References dict_intersection.

Referenced by boost::serialization::load(), and Parser::OperExpr::normalize().

478 { dict_intersection = true; }
bool dict_intersection
Definition: sqltypes.h:1277

+ Here is the caller graph for this function:

void SQLTypeInfo::set_dimension ( int  d)
inline

Definition at line 470 of file sqltypes.h.

References dimension.

Referenced by Analyzer::BinOper::analyze_type_info(), bind_function(), Catalog_Namespace::Catalog::buildColumnsMapUnlocked(), Parser::common_string_type(), json_utils::get_value(), boost::serialization::load(), parse_numeric(), File_Namespace::FileBuffer::readMetadata(), and ddl_utils::validate_and_set_type().

470 { dimension = d; }
int dimension
Definition: sqltypes.h:1270

+ Here is the caller graph for this function:

void SQLTypeInfo::set_fixed_size ( )
inline

Definition at line 477 of file sqltypes.h.

References get_storage_size(), and size.

Referenced by Parser::QuerySpec::analyze_group_by(), Analyzer::BinOper::common_numeric_type(), import_export::Importer::gdalToColumnDescriptorsGeo(), import_export::Importer::gdalToColumnDescriptorsRaster(), Analyzer::anonymous_namespace{Analyzer.cpp}::make_transient_dict_type(), Parser::OperExpr::normalize(), import_export::parse_add_metadata_columns(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::suggest_boolean_type_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::suggest_decimal_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::suggest_floating_point_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::suggest_integral_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::suggest_string_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::suggest_timestamp_mapping(), RelAlgTranslator::translateUoper(), and ddl_utils::validate_and_set_array_size().

477 { size = get_storage_size(); }
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:1284

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SQLTypeInfo::set_input_srid ( int  d)
inline
void SQLTypeInfo::set_output_srid ( int  s)
inline

Definition at line 474 of file sqltypes.h.

References scale.

Referenced by import_export::Importer::gdalToColumnDescriptorsGeo(), import_export::Importer::gdalToColumnDescriptorsRaster(), RelAlgTranslator::translateBinaryGeoConstructor(), RelAlgTranslator::translateGeoFunctionArg(), RelAlgTranslator::translateGeoLiteral(), RelAlgTranslator::translateUnaryGeoConstructor(), and ddl_utils::validate_and_set_type().

474 { scale = s; }

+ Here is the caller graph for this function:

void SQLTypeInfo::set_precision ( int  d)
inline
HOST DEVICE void SQLTypeInfo::set_type ( SQLTypes  t)
inline

Definition at line 468 of file sqltypes.h.

References type.

Referenced by Catalog_Namespace::Catalog::buildColumnsMapUnlocked(), import_export::Importer::gdalToColumnDescriptorsGeo(), import_export::Importer::gdalToColumnDescriptorsRaster(), get_array_type(), get_elem_type(), json_utils::get_value(), Geospatial::GeoTypesFactory::getGeoColumnsImpl(), boost::serialization::load(), Analyzer::anonymous_namespace{Analyzer.cpp}::make_transient_dict_type(), import_export::parse_add_metadata_columns(), File_Namespace::FileBuffer::readMetadata(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::suggest_boolean_type_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::suggest_decimal_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::suggest_floating_point_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::suggest_integral_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::suggest_string_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::suggest_timestamp_mapping(), RelAlgTranslator::translateBinaryGeoConstructor(), RelAlgTranslator::translateGeoFunctionArg(), RelAlgTranslator::translateUnaryGeoConstructor(), RelAlgTranslator::translateUoper(), and ddl_utils::validate_and_set_type().

468 { type = t; }
SQLTypes type
Definition: sqltypes.h:1268

+ Here is the caller graph for this function:

void SQLTypeInfo::setStorageSize ( )
inline

Definition at line 1051 of file sqltypes.h.

References get_storage_size(), and size.

Referenced by get_array_type(), and get_elem_type().

1051  {
1052  size = get_storage_size();
1053  }
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:1284

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SQLTypeInfo::setStringDictKey ( const shared::StringDictKey dict_key)
inline

Definition at line 1061 of file sqltypes.h.

References CHECK, comp_param, shared::StringDictKey::dict_id, and dict_key_.

Referenced by Analyzer::CaseExpr::add_cast(), Parser::QuerySpec::analyze_group_by(), Analyzer::BinOper::common_string_type(), anonymous_namespace{DdlCommandExecutor.cpp}::get_alter_column_src_dst_cds(), Analyzer::anonymous_namespace{Analyzer.cpp}::make_transient_dict_type(), Parser::OperExpr::normalize(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::set_dict_key(), RelAlgTranslator::translateUoper(), and type_info_from_thrift().

1061  {
1062  dict_key_ = dict_key;
1063  // If comp_param is set, it should equal dict_id.
1065  }
shared::StringDictKey dict_key_
Definition: sqltypes.h:1282
#define CHECK(condition)
Definition: Logger.h:291
int comp_param
Definition: sqltypes.h:1275

+ Here is the caller graph for this function:

void SQLTypeInfo::setStringDictKeySkipCompParamCheck ( const shared::StringDictKey dict_key)
inline

Definition at line 1072 of file sqltypes.h.

References dict_key_.

Referenced by json_utils::get_value().

1072  {
1073  dict_key_ = dict_key;
1074  }
shared::StringDictKey dict_key_
Definition: sqltypes.h:1282

+ Here is the caller graph for this function:

void SQLTypeInfo::setUsesFlatBuffer ( bool  uses_flatbuffer = true)
inline

Definition at line 1077 of file sqltypes.h.

References uses_flatbuffer_.

Referenced by get_elem_type().

1077  {
1078  uses_flatbuffer_ = uses_flatbuffer;
1079  }
bool uses_flatbuffer_
Definition: sqltypes.h:1283

+ Here is the caller graph for this function:

bool SQLTypeInfo::supportsFlatBuffer ( ) const
inline

Definition at line 1086 of file sqltypes.h.

References get_compression(), kARRAY, kCOLUMN, kCOLUMN_LIST, kENCODING_NONE, kLINESTRING, kMULTILINESTRING, kMULTIPOINT, kMULTIPOLYGON, kPOINT, kPOLYGON, kTEXT, type, and UNREACHABLE.

Referenced by bind_function().

1086  {
1087  switch (type) {
1088  case kARRAY:
1089  case kPOINT:
1090  case kLINESTRING:
1091  case kPOLYGON:
1092  case kMULTIPOINT:
1093  case kMULTILINESTRING:
1094  case kMULTIPOLYGON:
1095  return true;
1096  case kTEXT:
1097  return get_compression() == kENCODING_NONE;
1098  case kCOLUMN:
1099  case kCOLUMN_LIST:
1100  // calling supportsFlatBuffer on a column type is not meaningful
1101  UNREACHABLE();
1102  default:;
1103  }
1104  return false;
1105  }
#define UNREACHABLE()
Definition: Logger.h:338
Definition: sqltypes.h:79
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399
SQLTypes type
Definition: sqltypes.h:1268

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 526 of file sqltypes.h.

References dict_key_, get_comp_param(), get_compression_name(), get_dimension(), get_elem_type(), get_notnull(), get_scale(), get_size(), subtype, type, type_name, and uses_flatbuffer_.

Referenced by bind_function(), CodeGenerator::codegenHoistedConstantsLoads(), DatumToString(), RelLogicalUnion::getCompatibleMetainfoTypes(), operator<<(), TargetMetaInfo::toString(), TargetInfo::toString(), RexOperator::toString(), and toString().

526  {
527  std::ostringstream oss;
528  oss << "(type=" << type_name[static_cast<int>(type)]
529  << ", dimension=" << get_dimension() << ", scale=" << get_scale()
530  << ", null=" << (get_notnull() ? "not nullable" : "nullable")
531  << ", compression_name=" << get_compression_name()
532  << ", comp_param=" << get_comp_param()
533  << ", subtype=" << type_name[static_cast<int>(subtype)] << ", size=" << get_size()
534  << ", element_size=" << get_elem_type().get_size() << ", dict_key=" << dict_key_
535  << ", uses_flatbuffer=" << uses_flatbuffer_ << ")";
536  return oss.str();
537  }
HOST DEVICE int get_size() const
Definition: sqltypes.h:403
shared::StringDictKey dict_key_
Definition: sqltypes.h:1282
HOST DEVICE int get_scale() const
Definition: sqltypes.h:396
std::string get_compression_name() const
Definition: sqltypes.h:520
static std::string type_name[kSQLTYPE_LAST]
Definition: sqltypes.h:1279
SQLTypes subtype
Definition: sqltypes.h:1269
bool uses_flatbuffer_
Definition: sqltypes.h:1283
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:393
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:402
SQLTypes type
Definition: sqltypes.h:1268
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:398
SQLTypeInfo get_elem_type() const
Definition: sqltypes.h:975

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

SQLTypeInfoLite SQLTypeInfo::toLite ( ) const
inline

Definition at line 1107 of file sqltypes.h.

References SQLTypeInfoLite::ARRAY, SQLTypeInfoLite::BIGINT, SQLTypeInfoLite::BOOLEAN, SQLTypeInfoLite::compression, shared::StringDictKey::db_id, SQLTypeInfoLite::db_id, SQLTypeInfoLite::DICT, shared::StringDictKey::dict_id, SQLTypeInfoLite::dict_id, dict_key_, SQLTypeInfoLite::dimension, SQLTypeInfoLite::DOUBLE, SQLTypeInfoLite::FLOAT, SQLTypeInfoLite::GEOINT, get_compression(), get_input_srid(), get_output_srid(), SQLTypeInfoLite::INT, is_geometry(), kARRAY, kBIGINT, kBOOLEAN, kDOUBLE, kENCODING_DICT, kENCODING_GEOINT, kENCODING_NONE, kFLOAT, kINT, kLINESTRING, kMULTILINESTRING, kMULTIPOINT, kMULTIPOLYGON, kPOINT, kPOLYGON, kSMALLINT, kTEXT, kTINYINT, SQLTypeInfoLite::LINESTRING, SQLTypeInfoLite::MULTILINESTRING, SQLTypeInfoLite::MULTIPOINT, SQLTypeInfoLite::MULTIPOLYGON, SQLTypeInfoLite::NONE, SQLTypeInfoLite::POINT, SQLTypeInfoLite::POLYGON, SQLTypeInfoLite::scale, SQLTypeInfoLite::SMALLINT, SQLTypeInfoLite::subtype, subtype, SQLTypeInfoLite::TEXT, SQLTypeInfoLite::TINYINT, SQLTypeInfoLite::type, type, UNREACHABLE, and SQLTypeInfoLite::UNSPECIFIED.

Referenced by initializeFlatBuffer().

1107  {
1108  SQLTypeInfoLite ti_lite;
1109  switch (type) {
1110  case kPOINT:
1111  ti_lite.type = SQLTypeInfoLite::POINT;
1113  break;
1114  case kLINESTRING:
1117  break;
1118  case kPOLYGON:
1119  ti_lite.type = SQLTypeInfoLite::POLYGON;
1121  break;
1122  case kMULTIPOINT:
1125  break;
1126  case kMULTILINESTRING:
1129  break;
1130  case kMULTIPOLYGON:
1133  break;
1134  case kTEXT:
1135  ti_lite.type = SQLTypeInfoLite::TEXT;
1137  break;
1138  case kARRAY:
1139  ti_lite.type = SQLTypeInfoLite::ARRAY;
1140  switch (subtype) {
1141  case kBOOLEAN:
1143  break;
1144  case kTINYINT:
1146  break;
1147  case kSMALLINT:
1149  break;
1150  case kINT:
1151  ti_lite.subtype = SQLTypeInfoLite::INT;
1152  break;
1153  case kBIGINT:
1154  ti_lite.subtype = SQLTypeInfoLite::BIGINT;
1155  break;
1156  case kFLOAT:
1157  ti_lite.subtype = SQLTypeInfoLite::FLOAT;
1158  break;
1159  case kDOUBLE:
1160  ti_lite.subtype = SQLTypeInfoLite::DOUBLE;
1161  break;
1162  case kTEXT:
1163  ti_lite.subtype = SQLTypeInfoLite::TEXT;
1164  break;
1165  default:
1166  UNREACHABLE();
1167  }
1168  break;
1169  default:
1170  UNREACHABLE();
1171  }
1172  if (is_geometry()) {
1173  switch (get_compression()) {
1174  case kENCODING_NONE:
1176  break;
1177  case kENCODING_GEOINT:
1179  break;
1180  default:
1181  UNREACHABLE();
1182  }
1183  ti_lite.dimension = get_input_srid();
1184  ti_lite.scale = get_output_srid();
1185  ti_lite.db_id = 0; // unused
1186  ti_lite.dict_id = 0; // unused
1187  } else if (type == kTEXT) {
1188  switch (get_compression()) {
1189  case kENCODING_NONE:
1191  break;
1192  case kENCODING_DICT:
1194  break;
1195  default:
1196  UNREACHABLE();
1197  }
1198  ti_lite.dimension = 0; // unused
1199  ti_lite.scale = 0; // unused
1200  ti_lite.db_id = dict_key_.db_id;
1201  ti_lite.dict_id = dict_key_.dict_id;
1202  } else if (type == kARRAY) {
1203  if (subtype == kTEXT) {
1204  switch (get_compression()) {
1205  case kENCODING_NONE:
1207  break;
1208  case kENCODING_DICT:
1210  break;
1211  default:
1212  UNREACHABLE();
1213  }
1214  }
1215  ti_lite.dimension = 0; // unused
1216  ti_lite.scale = 0; // unused
1217  ti_lite.db_id = dict_key_.db_id;
1218  ti_lite.dict_id = dict_key_.dict_id;
1219  } else {
1220  UNREACHABLE();
1221  }
1222  return ti_lite;
1223  }
shared::StringDictKey dict_key_
Definition: sqltypes.h:1282
SQLTypes subtype
Definition: sqltypes_lite.h:54
#define UNREACHABLE()
Definition: Logger.h:338
EncodingType compression
Definition: sqltypes_lite.h:55
SQLTypes subtype
Definition: sqltypes.h:1269
Definition: sqltypes.h:79
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399
HOST DEVICE int get_input_srid() const
Definition: sqltypes.h:395
bool is_geometry() const
Definition: sqltypes.h:595
SQLTypes type
Definition: sqltypes.h:1268
Definition: sqltypes.h:72
HOST DEVICE int get_output_srid() const
Definition: sqltypes.h:397

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 523 of file sqltypes.h.

References to_string().

Referenced by shared::convert_temporal_to_iso_format(), Analyzer::ColumnVar::toString(), and ColumnarResults::writeBackCell().

523  {
524  return to_string();
525  } // for PRINT macro
std::string to_string() const
Definition: sqltypes.h:526

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

FlatBufferManager::ValueType SQLTypeInfo::toValueType ( ) const
inline

Definition at line 1225 of file sqltypes.h.

References FlatBufferManager::Bool8, FlatBufferManager::Float32, FlatBufferManager::Float64, get_compression(), FlatBufferManager::Int16, FlatBufferManager::Int32, FlatBufferManager::Int64, FlatBufferManager::Int8, kARRAY, kBIGINT, kBOOLEAN, kCOLUMN, kCOLUMN_LIST, kDOUBLE, kENCODING_DICT, kENCODING_GEOINT, kENCODING_NONE, kFLOAT, kINT, kLINESTRING, kMULTILINESTRING, kMULTIPOINT, kMULTIPOLYGON, kPOINT, kPOLYGON, kSMALLINT, kTEXT, kTINYINT, FlatBufferManager::PointFloat64, FlatBufferManager::PointInt32, subtype, type, and UNREACHABLE.

Referenced by getFlatBufferSize(), and initializeFlatBuffer().

1225  {
1226  SQLTypes sql_value_type =
1227  ((type == kCOLUMN || type == kCOLUMN_LIST || type == kARRAY) ? subtype : type);
1228  switch (sql_value_type) {
1229  case kPOINT:
1230  case kLINESTRING:
1231  case kPOLYGON:
1232  case kMULTIPOINT:
1233  case kMULTILINESTRING:
1234  case kMULTIPOLYGON:
1237  case kBOOLEAN:
1238  return FlatBufferManager::Bool8;
1239  case kTINYINT:
1240  return FlatBufferManager::Int8;
1241  case kSMALLINT:
1242  return FlatBufferManager::Int16;
1243  case kINT:
1244  return FlatBufferManager::Int32;
1245  case kBIGINT:
1246  return FlatBufferManager::Int64;
1247  case kFLOAT:
1249  case kDOUBLE:
1251  case kTEXT: {
1252  switch (get_compression()) {
1253  case kENCODING_NONE:
1254  return FlatBufferManager::Int8;
1255  case kENCODING_DICT:
1256  return FlatBufferManager::Int32;
1257  default:
1258  UNREACHABLE();
1259  }
1260  } break;
1261  default:
1262  UNREACHABLE();
1263  }
1264  return {};
1265  }
SQLTypes
Definition: sqltypes.h:65
#define UNREACHABLE()
Definition: Logger.h:338
SQLTypes subtype
Definition: sqltypes.h:1269
Definition: sqltypes.h:79
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399
SQLTypes type
Definition: sqltypes.h:1268
Definition: sqltypes.h:72

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SQLTypeInfo::transforms ( ) const
inline

Definition at line 624 of file sqltypes.h.

References get_input_srid(), get_output_srid(), IS_GEO, and type.

Referenced by CodeGenerator::codegenGeoBinOper(), CodeGenerator::codegenGeoUOper(), import_export::importGeoFromLonLat(), and foreign_storage::anonymous_namespace{TextFileBufferParser.cpp}::set_coordinates_from_separate_lon_lat_columns().

624  {
625  return IS_GEO(type) && get_input_srid() > 0 && get_output_srid() > 0 &&
627  }
HOST DEVICE int get_input_srid() const
Definition: sqltypes.h:395
SQLTypes type
Definition: sqltypes.h:1268
#define IS_GEO(T)
Definition: sqltypes.h:310
HOST DEVICE int get_output_srid() const
Definition: sqltypes.h:397

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SQLTypeInfo::usesFlatBuffer ( ) const
inline

Definition at line 1081 of file sqltypes.h.

References uses_flatbuffer_.

Referenced by TargetExprCodegen::codegen(), anonymous_namespace{TableFunctionCompilationContext.cpp}::get_llvm_type_from_sql_column_type(), ResultSet::getTargetValueFromBufferColwise(), ResultSet::getTargetValueFromBufferRowwise(), is_real_str_or_array(), and ColumnarResults::writeBackCell().

1081  {
1082  return uses_flatbuffer_;
1083  }
bool uses_flatbuffer_
Definition: sqltypes.h:1283

+ Here is the caller graph for this function:

Member Data Documentation

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

Definition at line 1280 of file sqltypes.h.

Referenced by get_compression_name().

int SQLTypeInfo::comp_param
private
bool SQLTypeInfo::dict_intersection {false}
private

Definition at line 1277 of file sqltypes.h.

Referenced by is_dict_intersection(), and set_dict_intersection().

bool SQLTypeInfo::notnull
private
std::string SQLTypeInfo::type_name
staticprivate

Definition at line 1279 of file sqltypes.h.

Referenced by get_type_name(), and to_string().

bool SQLTypeInfo::uses_flatbuffer_ {false}
private

Definition at line 1283 of file sqltypes.h.

Referenced by operator=(), setUsesFlatBuffer(), to_string(), and usesFlatBuffer().


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