OmniSciDB  c1a53651b2
 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
 
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
 
bool has_render_group () const
 
HOST DEVICE void set_type (SQLTypes t)
 
HOST DEVICE void set_subtype (SQLTypes st)
 
void set_dimension (int d)
 
void set_precision (int d)
 
void set_input_srid (int d)
 
void set_scale (int s)
 
void set_output_srid (int s)
 
void set_notnull (bool n)
 
void set_size (int s)
 
void set_fixed_size ()
 
void set_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_bytes () 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)
 

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_
 

Static Private Attributes

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

Detailed Description

Definition at line 322 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 324 of file sqltypes.h.

325  : type(t)
326  , subtype(st)
327  , dimension(d)
328  , scale(s)
329  , notnull(n)
330  , compression(c)
331  , comp_param(p)
332  , size(get_storage_size()) {}
SQLTypes subtype
Definition: sqltypes.h:1035
bool notnull
Definition: sqltypes.h:1039
EncodingType compression
Definition: sqltypes.h:1040
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:1049
SQLTypes type
Definition: sqltypes.h:1034
constexpr double n
Definition: Utm.h:38
int comp_param
Definition: sqltypes.h:1041
int dimension
Definition: sqltypes.h:1036
SQLTypeInfo::SQLTypeInfo ( SQLTypes  t,
int  d,
int  s,
bool  n 
)
inline

Definition at line 333 of file sqltypes.h.

334  : type(t)
335  , subtype(kNULLT)
336  , dimension(d)
337  , scale(s)
338  , notnull(n)
340  , comp_param(0)
341  , size(get_storage_size()) {}
SQLTypes subtype
Definition: sqltypes.h:1035
bool notnull
Definition: sqltypes.h:1039
EncodingType compression
Definition: sqltypes.h:1040
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:1049
SQLTypes type
Definition: sqltypes.h:1034
constexpr double n
Definition: Utm.h:38
int comp_param
Definition: sqltypes.h:1041
int dimension
Definition: sqltypes.h:1036
SQLTypeInfo::SQLTypeInfo ( SQLTypes  t,
EncodingType  c,
int  p,
SQLTypes  st 
)
inline

Definition at line 342 of file sqltypes.h.

343  : type(t)
344  , subtype(st)
345  , dimension(0)
346  , scale(0)
347  , notnull(false)
348  , compression(c)
349  , comp_param(p)
350  , size(get_storage_size()) {}
SQLTypes subtype
Definition: sqltypes.h:1035
bool notnull
Definition: sqltypes.h:1039
EncodingType compression
Definition: sqltypes.h:1040
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:1049
SQLTypes type
Definition: sqltypes.h:1034
int comp_param
Definition: sqltypes.h:1041
int dimension
Definition: sqltypes.h:1036
SQLTypeInfo::SQLTypeInfo ( SQLTypes  t,
int  d,
int  s 
)
inline

Definition at line 351 of file sqltypes.h.

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

Definition at line 352 of file sqltypes.h.

353  : type(t)
354  , subtype(kNULLT)
355  , dimension(0)
356  , scale(0)
357  , notnull(n)
359  , comp_param(0)
360  , size(get_storage_size()) {}
SQLTypes subtype
Definition: sqltypes.h:1035
bool notnull
Definition: sqltypes.h:1039
EncodingType compression
Definition: sqltypes.h:1040
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:1049
SQLTypes type
Definition: sqltypes.h:1034
constexpr double n
Definition: Utm.h:38
int comp_param
Definition: sqltypes.h:1041
int dimension
Definition: sqltypes.h:1036
SQLTypeInfo::SQLTypeInfo ( SQLTypes  t)
inline

Definition at line 361 of file sqltypes.h.

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

Definition at line 362 of file sqltypes.h.

363  : type(t)
364  , subtype(kNULLT)
365  , dimension(0)
366  , scale(0)
367  , notnull(n)
368  , compression(c)
369  , comp_param(0)
370  , size(get_storage_size()) {}
SQLTypes subtype
Definition: sqltypes.h:1035
bool notnull
Definition: sqltypes.h:1039
EncodingType compression
Definition: sqltypes.h:1040
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:1049
SQLTypes type
Definition: sqltypes.h:1034
constexpr double n
Definition: Utm.h:38
int comp_param
Definition: sqltypes.h:1041
int dimension
Definition: sqltypes.h:1036
SQLTypeInfo::SQLTypeInfo ( )
inline

Definition at line 371 of file sqltypes.h.

372  : type(kNULLT)
373  , subtype(kNULLT)
374  , dimension(0)
375  , scale(0)
376  , notnull(false)
378  , comp_param(0)
379  , size(0) {}
SQLTypes subtype
Definition: sqltypes.h:1035
bool notnull
Definition: sqltypes.h:1039
EncodingType compression
Definition: sqltypes.h:1040
SQLTypes type
Definition: sqltypes.h:1034
int comp_param
Definition: sqltypes.h:1041
int dimension
Definition: sqltypes.h:1036

Member Function Documentation

int SQLTypeInfo::get_array_context_logical_size ( ) const
inline

Definition at line 678 of file sqltypes.h.

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

Referenced by ResultSet::makeVarlenTargetValue().

678  {
679  if (is_string()) {
680  auto comp_type(get_compression());
681  if (comp_type == kENCODING_DICT || comp_type == kENCODING_FIXED ||
682  comp_type == kENCODING_NONE) {
683  return sizeof(int32_t);
684  }
685  }
686  return get_logical_size();
687  }
int get_logical_size() const
Definition: sqltypes.h:403
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:389
bool is_string() const
Definition: sqltypes.h:580

+ 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 980 of file sqltypes.h.

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

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

980  {
981  SQLTypeInfo type_info = *this;
982  type_info.set_type(kARRAY);
983  type_info.set_subtype(type);
984  type_info.setStorageSize();
985  return type_info;
986  }
HOST DEVICE void set_subtype(SQLTypes st)
Definition: sqltypes.h:494
void setStorageSize()
Definition: sqltypes.h:1019
SQLTypes type
Definition: sqltypes.h:1034
HOST DEVICE void set_type(SQLTypes t)
Definition: sqltypes.h:493

+ 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 560 of file sqltypes.h.

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

560  {
561  if (is_array()) {
562  return "Array";
563  }
564  if (is_bytes()) {
565  return "Bytes";
566  }
567 
568  if (is_column()) {
569  return "Column";
570  }
571 
572  assert(false);
573  return "";
574  }
bool is_column() const
Definition: sqltypes.h:593
bool is_bytes() const
Definition: sqltypes.h:603
bool is_array() const
Definition: sqltypes.h:588

+ Here is the call graph for this function:

HOST DEVICE int SQLTypeInfo::get_comp_param ( ) const
inline

Definition at line 392 of file sqltypes.h.

References comp_param.

Referenced by Analyzer::CaseExpr::add_cast(), Catalog_Namespace::Catalog::addColumn(), Catalog_Namespace::Catalog::addReferenceToForeignDict(), CodeGenerator::codegenCompression(), Analyzer::BinOper::common_string_type(), 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::delDictionary(), Catalog_Namespace::Catalog::doTruncateTable(), import_export::fill_missing_columns(), Catalog_Namespace::Catalog::gatherAdditionalInfo(), generate_column_type(), anonymous_namespace{ColumnIR.cpp}::get_col_decoder(), Geospatial::get_compression_scheme(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), Catalog_Namespace::Catalog::getColumnDictDirectory(), Catalog_Namespace::Catalog::getDictionaryToColumnMapping(), 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(), Catalog_Namespace::Catalog::serializeTableJsonUnlocked(), 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().

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

Definition at line 389 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(), anonymous_namespace{TableFunctionCompilationContext.cpp}::alloc_column(), anonymous_namespace{TableFunctionCompilationContext.cpp}::alloc_column_list(), 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(), import_export::ImporterUtils::composeNullPointCoords(), Geospatial::compress_coord(), Geospatial::compress_coords(), Geospatial::compress_null_point(), 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::delDictionary(), 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(), 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(), 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(), Chunk_NS::Chunk::getNumElemsForBytesInsertData(), import_export::Loader::getStringDict(), ResultSet::getTargetValueFromBufferRowwise(), has_same_itemtype(), Chunk_NS::Chunk::initEncoder(), inline_fixed_encoding_null_val(), inline_int_null_val(), CgenState::inlineIntNull(), is_bytes(), 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_unsigned_type(), RangeJoinHashTable::isInnerColCompressed(), ResultSet::isLessThan(), ChunkMetadata::isPlaceholder(), Fragmenter_Namespace::isStringVectorData(), ResultSet::makeGeoTargetValue(), ResultSet::makeVarlenTargetValue(), anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_arguments(), 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(), Catalog_Namespace::Catalog::serializeTableJsonUnlocked(), anonymous_namespace{TableOptimizer.cpp}::set_metadata_from_results(), Chunk_NS::Chunk::setChunkBuffer(), Fragmenter_Namespace::size_of_raw_column(), 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(), File_Namespace::FileBuffer::writeMetadata(), and import_export::TypedImportBuffer::~TypedImportBuffer().

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

Definition at line 545 of file sqltypes.h.

References comp_name, and compression.

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

545 { return comp_name[(int)compression]; }
EncodingType compression
Definition: sqltypes.h:1040
static std::string comp_name[kENCODING_LAST]
Definition: sqltypes.h:1046

+ Here is the caller graph for this function:

HOST DEVICE int SQLTypeInfo::get_dimension ( ) const
inline

Definition at line 383 of file sqltypes.h.

References dimension.

Referenced by Catalog_Namespace::Catalog::addColumn(), Analyzer::BinOper::analyze_type_info(), Analyzer::Constant::cast_string(), Analyzer::Constant::cast_to_string(), CodeGenerator::codegenCast(), CodeGenerator::codegenCastBetweenTimestamps(), CodeGenerator::codegenCastNonStringToString(), CodeGenerator::codegenDateTruncHighPrecisionTimestamps(), CodeGenerator::codegenExtractHighPrecisionTimestamps(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codgenAdjustFixedEncNull(), Analyzer::BinOper::common_numeric_type(), Parser::common_string_type(), Analyzer::BinOper::common_string_type(), 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(), Catalog_Namespace::Catalog::serializeTableJsonUnlocked(), StringToDatum(), to_string(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_timestamp_mapping(), and File_Namespace::FileBuffer::writeMetadata().

383 { return dimension; }
int dimension
Definition: sqltypes.h:1036

+ Here is the caller graph for this function:

SQLTypeInfo SQLTypeInfo::get_elem_type ( ) const
inline

Definition at line 963 of file sqltypes.h.

References compression, kARRAY, kCOLUMN, kCOLUMN_LIST, kENCODING_ARRAY, kENCODING_ARRAY_DICT, kENCODING_DICT, kENCODING_NONE, kNULLT, set_compression(), set_subtype(), set_type(), setStorageSize(), subtype, and type.

Referenced by import_export::TypedImportBuffer::add_value(), import_export::TypedImportBuffer::add_values(), 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(), 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(), getVarlenArrayBufferSize(), foreign_storage::ParquetArrayEncoder::initializeErrorTracking(), initializeVarlenArray(), 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().

963  {
964  SQLTypeInfo type_info = *this;
965  if ((type == kCOLUMN || type == kCOLUMN_LIST) && compression == kENCODING_ARRAY) {
966  type_info.set_type(kARRAY);
967  type_info.set_compression(kENCODING_NONE);
968  } else if ((type == kCOLUMN || type == kCOLUMN_LIST) &&
970  type_info.set_type(kARRAY);
971  type_info.set_compression(kENCODING_DICT);
972  } else {
973  type_info.set_type(subtype);
974  type_info.set_subtype(kNULLT);
975  }
976  type_info.setStorageSize();
977  return type_info;
978  }
void set_compression(EncodingType c)
Definition: sqltypes.h:504
HOST DEVICE void set_subtype(SQLTypes st)
Definition: sqltypes.h:494
SQLTypes subtype
Definition: sqltypes.h:1035
void setStorageSize()
Definition: sqltypes.h:1019
EncodingType compression
Definition: sqltypes.h:1040
SQLTypes type
Definition: sqltypes.h:1034
HOST DEVICE void set_type(SQLTypes t)
Definition: sqltypes.h:493

+ Here is the call graph for this function:

HOST DEVICE int SQLTypeInfo::get_input_srid ( ) const
inline
int SQLTypeInfo::get_logical_size ( ) const
inline

Definition at line 403 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(), 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().

403  {
406  return ti.get_size();
407  }
408  if (compression == kENCODING_DICT) {
409  return 4;
410  }
411  return get_size();
412  }
HOST DEVICE int get_size() const
Definition: sqltypes.h:393
SQLTypes subtype
Definition: sqltypes.h:1035
bool notnull
Definition: sqltypes.h:1039
EncodingType compression
Definition: sqltypes.h:1040
SQLTypes type
Definition: sqltypes.h:1034
int dimension
Definition: sqltypes.h:1036

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

HOST DEVICE bool SQLTypeInfo::get_notnull ( ) const
inline

Definition at line 388 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(), import_export::TypedImportBuffer::addDefaultValues(), Analyzer::BinOper::analyze_type_info(), foreign_storage::OdbcGeospatialEncoder::appendData(), foreign_storage::TypedParquetInPlaceEncoder< V, V >::appendDataTrackErrors(), anonymous_namespace{ResultSetIteration.cpp}::GeoTargetValueBuilder< GEO_SOURCE_TYPE, GeoTargetFetcher >::build(), anonymous_namespace{TableFunctionCompilationContext.cpp}::cast_value(), 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(), Geospatial::compress_coords(), anonymous_namespace{RelAlgExecutor.cpp}::anonymous_namespace{RelAlgExecutor.cpp}::conditionally_change_arg_to_int_type(), anonymous_namespace{ArrowResultSetConverter.cpp}::create_or_append_validity(), Catalog_Namespace::Catalog::createTable(), Analyzer::Expr::decompress(), Analyzer::InIntegerSet::deep_copy(), Analyzer::Constant::do_cast(), anonymous_namespace{ResultSetIteration.cpp}::GeoLazyFetchHandler::fetch(), anonymous_namespace{ResultSetIteration.cpp}::GeoQueryOutputFetchHandler::fetch(), get_agg_initial_val(), get_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(), Catalog_Namespace::Catalog::serializeTableJsonUnlocked(), Fragmenter_Namespace::set_chunk_stats(), anonymous_namespace{ResultSetReductionJIT.cpp}::target_info_key(), to_string(), ThriftSerializers::type_info_to_thrift(), Fragmenter_Namespace::anonymous_namespace{UpdelStorage.cpp}::update_metadata(), ddl_utils::validate_and_set_sparse_encoding(), foreign_storage::ParquetEncoder::validateNullCount(), DBHandler::value_to_thrift_column(), DeepCopyVisitor::visitInIntegerSet(), and File_Namespace::FileBuffer::writeMetadata().

388 { return notnull; }
bool notnull
Definition: sqltypes.h:1039
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 810 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().

810  {
811  CHECK(type == kBOOLEAN || type == kTINYINT || type == kSMALLINT || type == kINT ||
812  type == kBIGINT || type == kFLOAT || type == kDOUBLE || type == kDECIMAL ||
813  type == kNUMERIC || type == kTIMESTAMP || type == kDATE || type == kTIME);
814  switch (type) {
815  case kBOOLEAN:
816  return 1;
817  case kTINYINT:
818  case kSMALLINT:
819  case kINT:
820  case kBIGINT:
821  case kFLOAT:
822  case kDOUBLE:
823  return get_logical_size();
824  case kDECIMAL:
825  case kNUMERIC:
826  if (get_dimension() > 7) {
827  return 8;
828  } else {
829  return 4;
830  }
831  case kTIMESTAMP:
832  switch (get_dimension()) {
833  case 9:
834  return 8;
835  case 6:
836  return 4;
837  case 3:
838  return 2;
839  case 0:
840  return 1;
841  default:
842  UNREACHABLE();
843  }
844  case kDATE:
845  return 1;
846  case kTIME:
847  return 1;
848  default:
849  UNREACHABLE();
850  return 0;
851  }
852  }
Definition: sqltypes.h:66
#define UNREACHABLE()
Definition: Logger.h:337
int get_logical_size() const
Definition: sqltypes.h:403
Definition: sqltypes.h:70
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:383
#define CHECK(condition)
Definition: Logger.h:291
SQLTypes type
Definition: sqltypes.h:1034
Definition: sqltypes.h:62

+ 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 414 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(), Catalog_Namespace::Catalog::getAllColumnMetadataForTableImpl(), foreign_storage::ParquetDataWrapper::loadBuffersUsingLazyParquetChunkLoader(), and Catalog_Namespace::Catalog::renameColumn().

414  {
415  switch (type) {
416  case kPOINT:
417  return 1; // coords
418  case kMULTIPOINT:
419  return 2; // coords, bounds
420  case kLINESTRING:
421  return 2; // coords, bounds
422  case kMULTILINESTRING:
423  return 3; // coords, linestring_sizes, bounds
424  case kPOLYGON:
425  return 4; // coords, ring_sizes, bounds, render_group
426  case kMULTIPOLYGON:
427  return 5; // coords, ring_sizes, poly_rings, bounds, render_group
428  default:
429  break;
430  }
431  return 0;
432  }
SQLTypes type
Definition: sqltypes.h:1034

+ Here is the caller graph for this function:

int SQLTypeInfo::get_physical_coord_cols ( ) const
inline

Definition at line 433 of file sqltypes.h.

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

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

433  {
434  // @TODO dmitri/simon rename this function?
435  // It needs to return the number of extra columns
436  // which need to go through the executor, as opposed
437  // to those which are only needed by CPU for poly
438  // cache building or what-not. For now, we just omit
439  // the Render Group column. If we add Bounding Box
440  // or something this may require rethinking. Perhaps
441  // these two functions need to return an array of
442  // offsets rather than just a number to loop over,
443  // so that executor and non-executor columns can
444  // be mixed.
445  // NOTE(adb): In binding to extension functions, we need to know some pretty specific
446  // type info about each of the physical coords cols for each geo type. I added checks
447  // there to ensure the physical coords col for the geo type match what we expect. If
448  // these values are ever changed, corresponding values in
449  // ExtensionFunctionsBinding.cpp::compute_narrowing_conv_scores and
450  // ExtensionFunctionsBinding.cpp::compute_widening_conv_scores will also need to be
451  // changed.
452  switch (type) {
453  case kPOINT:
454  return 1;
455  case kMULTIPOINT:
456  return 1; // omit bounds
457  case kLINESTRING:
458  return 1; // omit bounds
459  case kMULTILINESTRING:
460  return 2; // omit bounds
461  case kPOLYGON:
462  return 2; // omit bounds, render group
463  case kMULTIPOLYGON:
464  return 3; // omit bounds, render group
465  default:
466  break;
467  }
468  return 0;
469  }
SQLTypes type
Definition: sqltypes.h:1034

+ Here is the caller graph for this function:

HOST DEVICE int SQLTypeInfo::get_scale ( ) const
inline

Definition at line 386 of file sqltypes.h.

References scale.

Referenced by Catalog_Namespace::Catalog::addColumn(), 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(), convert_decimal_value_to_scale(), Catalog_Namespace::Catalog::createTable(), DatumToString(), anonymous_namespace{TypedDataAccessors.h}::decimal_to_double(), DecimalOverflowValidator::DecimalOverflowValidator(), Analyzer::Expr::decompress(), 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(), Catalog_Namespace::Catalog::serializeTableJsonUnlocked(), 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().

386 { return scale; }

+ Here is the caller graph for this function:

HOST DEVICE int SQLTypeInfo::get_size ( ) const
inline

Definition at line 393 of file sqltypes.h.

References size.

Referenced by import_export::TypedImportBuffer::add_value(), Catalog_Namespace::Catalog::addColumn(), import_export::TypedImportBuffer::addDictEncodedString(), 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(), 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(), 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(), Executor::getNumBytesForFetchedRow(), Chunk_NS::Chunk::getNumElemsForBytesInsertData(), StorageIOFacility::getRsBufferNoPadding(), import_export::TypedImportBuffer::getStringDictBuffer(), getVarlenArrayBufferSize(), initializeVarlenArray(), 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(), Catalog_Namespace::Catalog::serializeTableJsonUnlocked(), 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(), File_Namespace::FileBuffer::writeMetadata(), and import_export::TypedImportBuffer::~TypedImportBuffer().

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

Definition at line 1049 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().

1049  {
1050  switch (type) {
1051  case kBOOLEAN:
1052  return sizeof(int8_t);
1053  case kTINYINT:
1054  return sizeof(int8_t);
1055  case kSMALLINT:
1056  switch (compression) {
1057  case kENCODING_NONE:
1058  return sizeof(int16_t);
1059  case kENCODING_FIXED:
1060  case kENCODING_SPARSE:
1061  return comp_param / 8;
1062  case kENCODING_RL:
1063  case kENCODING_DIFF:
1064  break;
1065  default:
1066  assert(false);
1067  }
1068  break;
1069  case kINT:
1070  switch (compression) {
1071  case kENCODING_NONE:
1072  return sizeof(int32_t);
1073  case kENCODING_FIXED:
1074  case kENCODING_SPARSE:
1075  case kENCODING_GEOINT:
1076  return comp_param / 8;
1077  case kENCODING_RL:
1078  case kENCODING_DIFF:
1079  break;
1080  default:
1081  assert(false);
1082  }
1083  break;
1084  case kBIGINT:
1085  case kNUMERIC:
1086  case kDECIMAL:
1087  switch (compression) {
1088  case kENCODING_NONE:
1089  return sizeof(int64_t);
1090  case kENCODING_FIXED:
1091  case kENCODING_SPARSE:
1092  return comp_param / 8;
1093  case kENCODING_RL:
1094  case kENCODING_DIFF:
1095  break;
1096  default:
1097  assert(false);
1098  }
1099  break;
1100  case kFLOAT:
1101  switch (compression) {
1102  case kENCODING_NONE:
1103  return sizeof(float);
1104  case kENCODING_FIXED:
1105  case kENCODING_RL:
1106  case kENCODING_DIFF:
1107  case kENCODING_SPARSE:
1108  assert(false);
1109  break;
1110  default:
1111  assert(false);
1112  }
1113  break;
1114  case kDOUBLE:
1115  switch (compression) {
1116  case kENCODING_NONE:
1117  return sizeof(double);
1118  case kENCODING_FIXED:
1119  case kENCODING_RL:
1120  case kENCODING_DIFF:
1121  case kENCODING_SPARSE:
1122  assert(false);
1123  break;
1124  default:
1125  assert(false);
1126  }
1127  break;
1128  case kTIMESTAMP:
1129  case kTIME:
1130  case kINTERVAL_DAY_TIME:
1131  case kINTERVAL_YEAR_MONTH:
1132  case kDATE:
1133  switch (compression) {
1134  case kENCODING_NONE:
1135  return sizeof(int64_t);
1136  case kENCODING_FIXED:
1137  if (type == kTIMESTAMP && dimension > 0) {
1138  assert(false); // disable compression for timestamp precisions
1139  }
1140  return comp_param / 8;
1141  case kENCODING_RL:
1142  case kENCODING_DIFF:
1143  case kENCODING_SPARSE:
1144  assert(false);
1145  break;
1147  switch (comp_param) {
1148  case 0:
1149  return 4; // Default date encoded in days is 32 bits
1150  case 16:
1151  case 32:
1152  return comp_param / 8;
1153  default:
1154  assert(false);
1155  break;
1156  }
1157  default:
1158  assert(false);
1159  }
1160  break;
1161  case kTEXT:
1162  case kVARCHAR:
1163  case kCHAR:
1164  if (compression == kENCODING_DICT) {
1165  return sizeof(int32_t); // @TODO(wei) must check DictDescriptor
1166  }
1167  break;
1168  case kARRAY:
1169  // TODO: return size for fixlen arrays?
1170  break;
1171  case kPOINT:
1172  case kMULTIPOINT:
1173  case kLINESTRING:
1174  case kMULTILINESTRING:
1175  case kPOLYGON:
1176  case kMULTIPOLYGON:
1177  case kCOLUMN:
1178  case kCOLUMN_LIST:
1179  break;
1180  default:
1181  break;
1182  }
1183  return -1;
1184  }
Definition: sqltypes.h:66
EncodingType compression
Definition: sqltypes.h:1040
Definition: sqltypes.h:69
Definition: sqltypes.h:70
Definition: sqltypes.h:58
SQLTypes type
Definition: sqltypes.h:1034
Definition: sqltypes.h:62
int comp_param
Definition: sqltypes.h:1041
int dimension
Definition: sqltypes.h:1036

+ Here is the caller graph for this function:

HOST DEVICE SQLTypes SQLTypeInfo::get_subtype ( ) const
inline

Definition at line 382 of file sqltypes.h.

References subtype.

Referenced by import_export::TypedImportBuffer::add_value(), import_export::TypedImportBuffer::add_values(), Catalog_Namespace::Catalog::addColumn(), anonymous_namespace{CastIR.cpp}::byte_array_cast(), import_export::TypedImportBuffer::clear(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codgenAdjustFixedEncNull(), anonymous_namespace{TableFunctionCompilationContext.cpp}::columnTypeRequiresCasting(), 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(), ColumnDescriptor::getDefaultValueLiteral(), 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(), Catalog_Namespace::Catalog::serializeTableJsonUnlocked(), 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(), File_Namespace::FileBuffer::writeMetadata(), and import_export::TypedImportBuffer::~TypedImportBuffer().

382 { return subtype; }
SQLTypes subtype
Definition: sqltypes.h:1035

+ Here is the caller graph for this function:

HOST DEVICE SQLTypes SQLTypeInfo::get_type ( ) const
inline

Definition at line 381 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(), import_export::TypedImportBuffer::addDefaultValues(), 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(), 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(), DBHandler::fillGeoColumns(), 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(), 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(), Geospatial::GeoTypesFactory::getGeoColumns(), PerfectJoinHashTable::getHashJoinArgs(), Geospatial::GeoTypesFactory::getNullGeoColumns(), Chunk_NS::Chunk::getNumElemsForBytesInsertData(), StorageIOFacility::getRsBufferNoPadding(), import_export::Loader::getStringDict(), Analyzer::ColumnVar::group_predicates(), foreign_storage::GeospatialEncoder::hasBoundsColumn(), foreign_storage::GeospatialEncoder::hasPolyRingsColumn(), foreign_storage::GeospatialEncoder::hasRenderGroupColumn(), foreign_storage::GeospatialEncoder::hasRingOrLineSizesColumn(), import_export::Importer::importDelimited(), import_export::Importer::importGDALGeo(), import_export::Importer::importGDALRaster(), Chunk_NS::Chunk::initEncoder(), inline_fp_null_val(), inline_int_null_val(), anonymous_namespace{Execute.cpp}::inline_null_val(), CgenState::inlineFpNull(), CgenState::inlineIntNull(), import_export::anonymous_namespace{QueryExporterGDAL.cpp}::insert_geo_column(), import_export::anonymous_namespace{QueryExporterGDAL.cpp}::insert_scalar_column(), is_castable(), Geospatial::is_null_point(), Analyzer::anonymous_namespace{Analyzer.cpp}::is_null_value(), 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(), Catalog_Namespace::Catalog::serializeTableJsonUnlocked(), 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(), 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(), RelAlgTranslator::translateBinaryGeoFunction(), RelAlgTranslator::translateGeoColumn(), RelAlgTranslator::translateGeoFunctionArg(), RelAlgTranslator::translateGeoLiteral(), RelAlgTranslator::translateGeoOverlapsOper(), 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(), foreign_storage::GeospatialEncoder::validateChunksSizing(), foreign_storage::GeospatialEncoder::validateMetadataSizing(), DBHandler::value_to_thrift(), DBHandler::value_to_thrift_column(), anonymous_namespace{WindowExpressionRewrite.cpp}::window_sum_and_count_match(), File_Namespace::FileBuffer::writeMetadata(), and import_export::TypedImportBuffer::~TypedImportBuffer().

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

Definition at line 507 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(), anonymous_namespace{TableFunctionCompilationContext.cpp}::cast_value(), 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(), 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(), RexAgg::toHash(), 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().

507  {
508  if (IS_GEO(type)) {
509  std::string srid_string = "";
510  if (get_output_srid() > 0) {
511  srid_string = ", " + std::to_string(get_output_srid());
512  }
513  CHECK_LT(static_cast<int>(subtype), kSQLTYPE_LAST);
514  return type_name[static_cast<int>(subtype)] + "(" +
515  type_name[static_cast<int>(type)] + srid_string + ")";
516  }
517  std::string ps = "";
518  if (type == kDECIMAL || type == kNUMERIC) {
519  ps = "(" + std::to_string(dimension) + "," + std::to_string(scale) + ")";
520  } else if (type == kTIMESTAMP) {
521  ps = "(" + std::to_string(dimension) + ")";
522  }
523  if (type == kARRAY) {
524  auto elem_ti = get_elem_type();
525  auto num_elems = (size > 0) ? std::to_string(size / elem_ti.get_size()) : "";
526  CHECK_LT(static_cast<int>(subtype), kSQLTYPE_LAST);
527  return elem_ti.get_type_name() + ps + "[" + num_elems + "]";
528  }
529  if (type == kCOLUMN) {
530  auto elem_ti = get_elem_type();
531  auto num_elems =
532  (size > 0) ? "[" + std::to_string(size / elem_ti.get_size()) + "]" : "";
533  CHECK_LT(static_cast<int>(subtype), kSQLTYPE_LAST);
534  return "COLUMN<" + elem_ti.get_type_name() + ps + ">" + num_elems;
535  }
536  if (type == kCOLUMN_LIST) {
537  auto elem_ti = get_elem_type();
538  auto num_elems =
539  (size > 0) ? "[" + std::to_string(size / elem_ti.get_size()) + "]" : "";
540  CHECK_LT(static_cast<int>(subtype), kSQLTYPE_LAST);
541  return "COLUMN_LIST<" + elem_ti.get_type_name() + ps + ">" + num_elems;
542  }
543  return type_name[static_cast<int>(type)] + ps;
544  }
std::string to_string(char const *&&v)
static std::string type_name[kSQLTYPE_LAST]
Definition: sqltypes.h:1045
SQLTypes subtype
Definition: sqltypes.h:1035
#define CHECK_LT(x, y)
Definition: Logger.h:303
SQLTypes type
Definition: sqltypes.h:1034
SQLTypeInfo get_elem_type() const
Definition: sqltypes.h:963
#define IS_GEO(T)
Definition: sqltypes.h:300
int dimension
Definition: sqltypes.h:1036
HOST DEVICE int get_output_srid() const
Definition: sqltypes.h:387

+ 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 1021 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(), ResultSet::getString(), Analyzer::anonymous_namespace{Analyzer.cpp}::has_same_dict(), ArrowResultSetConverter::initializeColumnBuilder(), initializeVarlenArray(), Parser::OperExpr::normalize(), TextConverterFactory::operator()(), translate_dict_strings(), ThriftSerializers::type_info_to_thrift(), TransientDictIdVisitor::visitCaseExpr(), TransientDictIdVisitor::visitStringOper(), and TransientDictIdVisitor::visitUOper().

1021  {
1022  // If comp_param is set, it should equal dict_id.
1024  return dict_key_;
1025  }
shared::StringDictKey dict_key_
Definition: sqltypes.h:1048
#define CHECK(condition)
Definition: Logger.h:291
int comp_param
Definition: sqltypes.h:1041

+ Here is the caller graph for this function:

bool SQLTypeInfo::has_bounds ( ) const
inline

Definition at line 470 of file sqltypes.h.

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

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

470  {
471  switch (type) {
472  case kMULTIPOINT:
473  case kLINESTRING:
474  case kMULTILINESTRING:
475  case kPOLYGON:
476  case kMULTIPOLYGON:
477  return true;
478  default:
479  break;
480  }
481  return false;
482  }
SQLTypes type
Definition: sqltypes.h:1034

+ Here is the caller graph for this function:

bool SQLTypeInfo::has_render_group ( ) const
inline

Definition at line 483 of file sqltypes.h.

References kMULTIPOLYGON, kPOLYGON, and type.

Referenced by RelAlgTranslator::translateGeoColumn().

483  {
484  switch (type) {
485  case kPOLYGON:
486  case kMULTIPOLYGON:
487  return true;
488  default:
489  break;
490  }
491  return false;
492  }
SQLTypes type
Definition: sqltypes.h:1034

+ Here is the caller graph for this function:

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

Definition at line 651 of file sqltypes.h.

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

651  {
652  if ((is_column() || is_column_list()) &&
653  (other.is_column() || other.is_column_list())) {
654  return subtype == other.get_subtype() &&
656  compression == other.get_compression());
657  }
658  return subtype == other.get_subtype();
659  }
HOST DEVICE SQLTypes get_subtype() const
Definition: sqltypes.h:382
SQLTypes subtype
Definition: sqltypes.h:1035
EncodingType compression
Definition: sqltypes.h:1040
bool is_column() const
Definition: sqltypes.h:593
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:389
bool is_column_list() const
Definition: sqltypes.h:594

+ Here is the call graph for this function:

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

Definition at line 577 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().

577  {
578  return (... || (types == type));
579  }
SQLTypes type
Definition: sqltypes.h:1034

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_array ( ) const
inline

Definition at line 588 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(), anonymous_namespace{TableFunctionCompilationContext.cpp}::get_llvm_type_from_sql_column_type(), 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(), getVarlenArrayBufferSize(), CodeGenerator::hashJoinLhs(), ArrowResultSetConverter::initializeColumnBuilder(), initializeVarlenArray(), is_buffer(), is_dict_encoded_type(), is_real_str_or_array(), 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_array_mapping(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_max_repetition_and_definition_level(), DBHandler::value_to_thrift(), and DBHandler::value_to_thrift_column().

588 { return type == kARRAY; } // Array
SQLTypes type
Definition: sqltypes.h:1034
bool SQLTypeInfo::is_boolean ( ) const
inline

Definition at line 587 of file sqltypes.h.

References kBOOLEAN, and type.

Referenced by Analyzer::BinOper::analyze_type_info(), 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().

587 { return type == kBOOLEAN; }
SQLTypes type
Definition: sqltypes.h:1034

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_buffer ( ) const
inline

Definition at line 612 of file sqltypes.h.

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

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

612  {
613  return is_array() || is_column() || is_column_list() || is_bytes();
614  }
bool is_column() const
Definition: sqltypes.h:593
bool is_bytes() const
Definition: sqltypes.h:603
bool is_column_list() const
Definition: sqltypes.h:594
bool is_array() const
Definition: sqltypes.h:588

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_bytes ( ) const
inline

Definition at line 603 of file sqltypes.h.

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

Referenced by 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(), and is_buffer().

603  {
604  return type == kTEXT && get_compression() == kENCODING_NONE;
605  }
Definition: sqltypes.h:69
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:389
SQLTypes type
Definition: sqltypes.h:1034

+ 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 701 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().

701  {
702  // can always cast between the same type but different precision/scale/encodings
703  if (type == new_type_info.get_type()) {
704  return true;
705  // can always cast between strings
706  } else if (is_string() && new_type_info.is_string()) {
707  return true;
708  } else if (is_string() && !new_type_info.is_string()) {
709  return false;
710  } else if (!is_string() && new_type_info.is_string()) {
711  return true;
712  // can cast between numbers
713  } else if (is_number() && new_type_info.is_number()) {
714  return true;
715  // can cast from timestamp or date to number (epoch)
716  } else if ((type == kTIMESTAMP || type == kDATE) && new_type_info.is_number()) {
717  return true;
718  // can cast from number (epoch) to timestamp, date, or time
719  } else if (is_number() && new_type_info.is_time()) {
720  return true;
721  // can cast from date to timestamp
722  } else if (type == kDATE && new_type_info.get_type() == kTIMESTAMP) {
723  return true;
724  } else if (type == kTIMESTAMP && new_type_info.get_type() == kDATE) {
725  return true;
726  } else if (type == kTIMESTAMP && new_type_info.get_type() == kTIME) {
727  return true;
728  } else if (type == kBOOLEAN && new_type_info.is_number()) {
729  return true;
730  } else if (type == kARRAY && new_type_info.get_type() == kARRAY) {
731  return get_elem_type().is_castable(new_type_info.get_elem_type());
732  } else if (type == kCOLUMN && new_type_info.get_type() == kCOLUMN) {
733  return get_elem_type().is_castable(new_type_info.get_elem_type());
734  } else if (type == kCOLUMN_LIST && new_type_info.get_type() == kCOLUMN_LIST) {
735  return get_elem_type().is_castable(new_type_info.get_elem_type());
736  } else {
737  return false;
738  }
739  }
Definition: sqltypes.h:66
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:381
bool is_number() const
Definition: sqltypes.h:585
bool is_time() const
Definition: sqltypes.h:586
bool is_castable(const SQLTypeInfo &new_type_info) const
Definition: sqltypes.h:701
Definition: sqltypes.h:70
SQLTypes type
Definition: sqltypes.h:1034
bool is_string() const
Definition: sqltypes.h:580
SQLTypeInfo get_elem_type() const
Definition: sqltypes.h:963

+ 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 593 of file sqltypes.h.

References kCOLUMN, and type.

Referenced by anonymous_namespace{TableFunctionCompilationContext.cpp}::columnTypeRequiresCasting(), get_buffer_name(), has_same_itemtype(), is_buffer(), and DBHandler::value_to_thrift_column().

593 { return type == kCOLUMN; } // Column
SQLTypes type
Definition: sqltypes.h:1034

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_column_array ( ) const
inline

Definition at line 595 of file sqltypes.h.

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

595  {
596  const auto c = get_compression();
597  return type == kCOLUMN && (c == kENCODING_ARRAY || c == kENCODING_ARRAY_DICT);
598  } // ColumnArray
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:389
SQLTypes type
Definition: sqltypes.h:1034

+ Here is the call graph for this function:

bool SQLTypeInfo::is_column_list ( ) const
inline

Definition at line 594 of file sqltypes.h.

References kCOLUMN_LIST, and type.

Referenced by has_same_itemtype(), and is_buffer().

594 { return type == kCOLUMN_LIST; } // ColumnList
SQLTypes type
Definition: sqltypes.h:1034

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_column_list_array ( ) const
inline

Definition at line 599 of file sqltypes.h.

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

599  {
600  const auto c = get_compression();
601  return type == kCOLUMN_LIST && (c == kENCODING_ARRAY || c == kENCODING_ARRAY_DICT);
602  } // ColumnList of ColumnArray
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:389
SQLTypes type
Definition: sqltypes.h:1034

+ Here is the call graph for this function:

bool SQLTypeInfo::is_date_in_days ( ) const
inline

Definition at line 988 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().

988  {
989  if (type == kDATE) {
990  const auto comp_type = get_compression();
991  if (comp_type == kENCODING_DATE_IN_DAYS) {
992  return true;
993  }
994  }
995  return false;
996  }
Definition: sqltypes.h:70
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:389
SQLTypes type
Definition: sqltypes.h:1034

+ 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 583 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(), 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().

583 { return type == kDECIMAL || type == kNUMERIC; }
SQLTypes type
Definition: sqltypes.h:1034

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_dict_encoded_string ( ) const
inline

Definition at line 632 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{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().

632  {
633  return is_string() && compression == kENCODING_DICT;
634  }
EncodingType compression
Definition: sqltypes.h:1040
bool is_string() const
Definition: sqltypes.h:580

+ 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 644 of file sqltypes.h.

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

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

644  {
645  return is_dict_encoded_string() ||
647  }
bool is_dict_encoded_string() const
Definition: sqltypes.h:632
SQLTypeInfo get_elem_type() const
Definition: sqltypes.h:963
bool is_array() const
Definition: sqltypes.h:588

+ 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 649 of file sqltypes.h.

References dict_intersection.

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

649 { return dict_intersection; }
bool dict_intersection
Definition: sqltypes.h:1043

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_encoded_timestamp ( ) const
inline

Definition at line 1015 of file sqltypes.h.

References compression, is_timestamp(), and kENCODING_FIXED.

1015  {
1016  return is_timestamp() && compression == kENCODING_FIXED;
1017  }
bool is_timestamp() const
Definition: sqltypes.h:1014
EncodingType compression
Definition: sqltypes.h:1040

+ Here is the call graph for this function:

bool SQLTypeInfo::is_fixlen_array ( ) const
inline

Definition at line 590 of file sqltypes.h.

References kARRAY, size, and type.

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

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

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_fp ( ) const
inline

Definition at line 584 of file sqltypes.h.

References kDOUBLE, kFLOAT, and type.

Referenced by Analyzer::Constant::add_cast(), 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().

584 { return type == kFLOAT || type == kDOUBLE; }
SQLTypes type
Definition: sqltypes.h:1034

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_geometry ( ) const
inline

Definition at line 592 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::codegenColVar(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codegenHoistedConstantsPlaceholders(), Catalog_Namespace::Catalog::createTable(), 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(), 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(), and Analyzer::Constant::~Constant().

592 { return IS_GEO(type); }
SQLTypes type
Definition: sqltypes.h:1034
#define IS_GEO(T)
Definition: sqltypes.h:300

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_high_precision_timestamp ( ) const
inline

Definition at line 1004 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().

1004  {
1005  if (type == kTIMESTAMP) {
1006  const auto dimension = get_dimension();
1007  if (dimension > 0) {
1008  return true;
1009  }
1010  }
1011  return false;
1012  }
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:383
SQLTypes type
Definition: sqltypes.h:1034
int dimension
Definition: sqltypes.h:1036

+ 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 582 of file sqltypes.h.

References IS_INTEGER, and type.

Referenced by Analyzer::Constant::add_cast(), Parser::FunctionRef::analyze(), Analyzer::BinOper::analyze_type_info(), WindowFunctionContext::buildAggregationTreeForPartition(), CodeGenerator::castArrayPointer(), CodeGenerator::codegenAdd(), CodeGenerator::codegenCast(), CodeGenerator::codegenCastBetweenIntTypes(), CodeGenerator::codegenCastFromFp(), CodeGenerator::codegenCmp(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codegenMod(), CodeGenerator::codegenMul(), CodeGenerator::codegenSub(), Analyzer::WidthBucketExpr::compute_bucket(), 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().

582 { return IS_INTEGER(type); }
#define IS_INTEGER(T)
Definition: sqltypes.h:294
SQLTypes type
Definition: sqltypes.h:1034

+ Here is the caller graph for this function:

int SQLTypeInfo::is_logical_geo_type ( ) const
inline

Definition at line 395 of file sqltypes.h.

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

395  {
396  if (type == kPOINT || type == kLINESTRING || type == kMULTILINESTRING ||
397  type == kMULTIPOINT || type == kPOLYGON || type == kMULTIPOLYGON) {
398  return true;
399  }
400  return false;
401  }
SQLTypes type
Definition: sqltypes.h:1034
bool SQLTypeInfo::is_none_encoded_string ( ) const
inline

Definition at line 636 of file sqltypes.h.

References compression, is_string(), and kENCODING_NONE.

Referenced by Parser::common_string_type().

636  {
637  return is_string() && compression == kENCODING_NONE;
638  }
EncodingType compression
Definition: sqltypes.h:1040
bool is_string() const
Definition: sqltypes.h:580

+ 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 854 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().

854  {
855  // assuming Datum is always uncompressed
856  switch (type) {
857  case kBOOLEAN:
858  return (int8_t)d.boolval == NULL_BOOLEAN;
859  case kTINYINT:
860  return d.tinyintval == NULL_TINYINT;
861  case kSMALLINT:
862  return d.smallintval == NULL_SMALLINT;
863  case kINT:
864  return d.intval == NULL_INT;
865  case kBIGINT:
866  case kNUMERIC:
867  case kDECIMAL:
868  return d.bigintval == NULL_BIGINT;
869  case kFLOAT:
870  return d.floatval == NULL_FLOAT;
871  case kDOUBLE:
872  return d.doubleval == NULL_DOUBLE;
873  case kTIME:
874  case kTIMESTAMP:
875  case kDATE:
876  return d.bigintval == NULL_BIGINT;
877  case kTEXT:
878  case kVARCHAR:
879  case kCHAR:
880  // @TODO handle null strings
881  break;
882  case kNULLT:
883  return true;
884  case kARRAY:
885  return d.arrayval == NULL || d.arrayval->is_null;
886  default:
887  break;
888  }
889  return false;
890  }
int8_t tinyintval
Definition: Datum.h:69
#define NULL_DOUBLE
Definition: sqltypes.h:66
#define NULL_FLOAT
bool is_null
Definition: Datum.h:55
#define NULL_BIGINT
int8_t boolval
Definition: Datum.h:68
VarlenDatum * arrayval
Definition: Datum.h:75
int32_t intval
Definition: Datum.h:71
#define NULL_INT
float floatval
Definition: Datum.h:73
int64_t bigintval
Definition: Datum.h:72
int16_t smallintval
Definition: Datum.h:70
#define NULL_BOOLEAN
Definition: sqltypes.h:69
Definition: sqltypes.h:70
Definition: sqltypes.h:58
#define NULL_TINYINT
SQLTypes type
Definition: sqltypes.h:1034
#define NULL_SMALLINT
Definition: sqltypes.h:62
double doubleval
Definition: Datum.h:74

+ Here is the caller graph for this function:

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

Definition at line 891 of file sqltypes.h.

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

891  {
892  if (type == kFLOAT) {
893  return *(float*)val == NULL_FLOAT;
894  }
895  if (type == kDOUBLE) {
896  return *(double*)val == NULL_DOUBLE;
897  }
898  // val can be either compressed or uncompressed
899  switch (size) {
900  case 1:
901  return *val == NULL_TINYINT;
902  case 2:
903  return *(int16_t*)val == NULL_SMALLINT;
904  case 4:
905  return *(int32_t*)val == NULL_INT;
906  case 8:
907  return *(int64_t*)val == NULL_BIGINT;
908  case kNULLT:
909  return true;
910  default:
911  // @TODO(wei) handle null strings
912  break;
913  }
914  return false;
915  }
#define NULL_DOUBLE
#define NULL_FLOAT
#define NULL_BIGINT
#define NULL_INT
#define NULL_TINYINT
SQLTypes type
Definition: sqltypes.h:1034
#define NULL_SMALLINT
HOST DEVICE bool SQLTypeInfo::is_null_fixlen_array ( const int8_t *  val,
int  array_size 
) const
inline

Definition at line 916 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().

916  {
917  // Check if fixed length array has a NULL_ARRAY sentinel as the first element
918  if (type == kARRAY && val && array_size > 0 && array_size == size) {
919  // Need to create element type to get the size, but can't call get_elem_type()
920  // since this is a HOST DEVICE function. Going through copy constructor instead.
921  auto elem_ti{*this};
922  elem_ti.set_type(subtype);
923  elem_ti.set_subtype(kNULLT);
924  auto elem_size = elem_ti.get_storage_size();
925  if (elem_size < 1) {
926  return false;
927  }
928  if (subtype == kFLOAT) {
929  return *(float*)val == NULL_ARRAY_FLOAT;
930  }
931  if (subtype == kDOUBLE) {
932  return *(double*)val == NULL_ARRAY_DOUBLE;
933  }
934  switch (elem_size) {
935  case 1:
936  return *val == NULL_ARRAY_TINYINT;
937  case 2:
938  return *(int16_t*)val == NULL_ARRAY_SMALLINT;
939  case 4:
940  return *(int32_t*)val == NULL_ARRAY_INT;
941  case 8:
942  return *(int64_t*)val == NULL_ARRAY_BIGINT;
943  default:
944  return false;
945  }
946  }
947  return false;
948  }
#define NULL_ARRAY_INT
#define NULL_ARRAY_SMALLINT
#define NULL_ARRAY_TINYINT
SQLTypes subtype
Definition: sqltypes.h:1035
#define NULL_ARRAY_FLOAT
#define NULL_ARRAY_DOUBLE
SQLTypes type
Definition: sqltypes.h:1034
#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 949 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().

950  {
951  if (type == kARRAY && subtype == kTINYINT && val && array_size > 0 &&
952  array_size == size) {
953  if (array_size == 2 * sizeof(double)) {
954  return *(double*)val == NULL_ARRAY_DOUBLE;
955  }
956  if (array_size == 2 * sizeof(int32_t)) {
957  return *(uint32_t*)val == NULL_ARRAY_COMPRESSED_32;
958  }
959  }
960  return false;
961  }
#define NULL_ARRAY_COMPRESSED_32
SQLTypes subtype
Definition: sqltypes.h:1035
#define NULL_ARRAY_DOUBLE
SQLTypes type
Definition: sqltypes.h:1034

+ 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 749 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().

749  {
750  const auto& new_type = new_type_info.get_type();
751  switch (type) {
752  case kBOOLEAN:
753  return new_type == kBOOLEAN;
754  case kTINYINT:
755  case kSMALLINT:
756  case kINT:
757  if (!new_type_info.is_number()) {
758  return false;
759  }
760  if (new_type_info.is_fp()) {
761  // We can lose precision here, but preserving existing behavior
762  return true;
763  }
764  return new_type_info.get_logical_size() >= get_logical_size();
765  case kBIGINT:
766  return new_type == kBIGINT || new_type == kDOUBLE || new_type == kFLOAT;
767  case kFLOAT:
768  case kDOUBLE:
769  if (!new_type_info.is_fp()) {
770  return false;
771  }
772  return (new_type_info.get_logical_size() >= get_logical_size());
773  case kDECIMAL:
774  case kNUMERIC:
775  switch (new_type) {
776  case kDECIMAL:
777  case kNUMERIC:
778  return new_type_info.get_dimension() >= get_dimension();
779  case kDOUBLE:
780  return true;
781  case kFLOAT:
782  return get_dimension() <= 7;
783  default:
784  return false;
785  }
786  case kTIMESTAMP:
787  if (new_type != kTIMESTAMP) {
788  return false;
789  }
790  return new_type_info.get_dimension() >= get_dimension();
791  case kDATE:
792  return new_type == kDATE;
793  case kTIME:
794  return new_type == kTIME;
795  default:
796  UNREACHABLE();
797  return false;
798  }
799  }
Definition: sqltypes.h:66
bool is_fp() const
Definition: sqltypes.h:584
#define UNREACHABLE()
Definition: Logger.h:337
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:381
bool is_number() const
Definition: sqltypes.h:585
int get_logical_size() const
Definition: sqltypes.h:403
Definition: sqltypes.h:70
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:383
SQLTypes type
Definition: sqltypes.h:1034
Definition: sqltypes.h:62

+ 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 580 of file sqltypes.h.

References IS_STRING, and type.

Referenced by Analyzer::Expr::add_cast(), Analyzer::UOper::add_cast(), Analyzer::CaseExpr::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::delDictionary(), 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(), 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(), 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().

580 { return IS_STRING(type); }
#define IS_STRING(T)
Definition: sqltypes.h:299
SQLTypes type
Definition: sqltypes.h:1034
bool SQLTypeInfo::is_string_array ( ) const
inline

Definition at line 581 of file sqltypes.h.

References IS_STRING, kARRAY, subtype, and type.

Referenced by Catalog_Namespace::Catalog::delDictionary(), 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().

581 { return (type == kARRAY) && IS_STRING(subtype); }
SQLTypes subtype
Definition: sqltypes.h:1035
#define IS_STRING(T)
Definition: sqltypes.h:299
SQLTypes type
Definition: sqltypes.h:1034

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_subtype_dict_encoded_string ( ) const
inline

Definition at line 640 of file sqltypes.h.

References compression, IS_STRING, kENCODING_DICT, and subtype.

Referenced by type_info_from_thrift().

640  {
642  }
SQLTypes subtype
Definition: sqltypes.h:1035
EncodingType compression
Definition: sqltypes.h:1040
#define IS_STRING(T)
Definition: sqltypes.h:299

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_text_encoding_dict ( ) const
inline

Definition at line 606 of file sqltypes.h.

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

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

606  {
607  return type == kTEXT && get_compression() == kENCODING_DICT;
608  }
Definition: sqltypes.h:69
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:389
SQLTypes type
Definition: sqltypes.h:1034

+ 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 609 of file sqltypes.h.

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

Referenced by getVarlenArrayBufferSize(), and initializeVarlenArray().

609  {
610  return type == kARRAY && subtype == kTEXT && get_compression() == kENCODING_DICT;
611  }
SQLTypes subtype
Definition: sqltypes.h:1035
Definition: sqltypes.h:69
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:389
SQLTypes type
Definition: sqltypes.h:1034

+ 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 586 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().

586 { return is_datetime(type); }
SQLTypes type
Definition: sqltypes.h:1034
constexpr auto is_datetime(SQLTypes type)
Definition: sqltypes.h:315

+ 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 1000 of file sqltypes.h.

References kDATE, kTIME, kTIMESTAMP, and type.

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

1000  {
1001  return type == kDATE || type == kTIME || type == kTIMESTAMP;
1002  }
Definition: sqltypes.h:66
Definition: sqltypes.h:70
SQLTypes type
Definition: sqltypes.h:1034

+ Here is the caller graph for this function:

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

Definition at line 589 of file sqltypes.h.

References kARRAY, size, and type.

Referenced by Fragmenter_Namespace::get_var_len_null_array_indexes().

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

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_varlen_indeed ( ) const
inline

Definition at line 626 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(), foreign_storage::get_placeholder_metadata(), and foreign_storage::Csv::get_placeholder_metadata().

626  {
627  // SQLTypeInfo.is_varlen() is broken with fixedlen array now
628  // and seems left broken for some concern, so fix it locally
629  return is_varlen() && !is_fixlen_array();
630  }
bool is_varlen() const
Definition: sqltypes.h:620
bool is_fixlen_array() const
Definition: sqltypes.h:590

+ 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 661 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.

661  {
662  return type != rhs.get_type() || subtype != rhs.get_subtype() ||
663  dimension != rhs.get_dimension() || scale != rhs.get_scale() ||
664  compression != rhs.get_compression() ||
667  notnull != rhs.get_notnull() || dict_key_ != rhs.dict_key_;
668  }
HOST DEVICE SQLTypes get_subtype() const
Definition: sqltypes.h:382
shared::StringDictKey dict_key_
Definition: sqltypes.h:1048
HOST DEVICE int get_scale() const
Definition: sqltypes.h:386
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:381
SQLTypes subtype
Definition: sqltypes.h:1035
bool notnull
Definition: sqltypes.h:1039
EncodingType compression
Definition: sqltypes.h:1040
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:389
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:383
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:392
SQLTypes type
Definition: sqltypes.h:1034
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:388
#define TRANSIENT_DICT(ID)
Definition: sqltypes.h:312
int comp_param
Definition: sqltypes.h:1041
int dimension
Definition: sqltypes.h:1036

+ Here is the call graph for this function:

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

Definition at line 689 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, and type.

689  {
690  type = rhs.get_type();
691  subtype = rhs.get_subtype();
692  dimension = rhs.get_dimension();
693  scale = rhs.get_scale();
694  notnull = rhs.get_notnull();
696  comp_param = rhs.get_comp_param();
697  size = rhs.get_size();
698  dict_key_ = rhs.dict_key_;
699  }
HOST DEVICE SQLTypes get_subtype() const
Definition: sqltypes.h:382
HOST DEVICE int get_size() const
Definition: sqltypes.h:393
shared::StringDictKey dict_key_
Definition: sqltypes.h:1048
HOST DEVICE int get_scale() const
Definition: sqltypes.h:386
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:381
SQLTypes subtype
Definition: sqltypes.h:1035
bool notnull
Definition: sqltypes.h:1039
EncodingType compression
Definition: sqltypes.h:1040
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:389
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:383
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:392
SQLTypes type
Definition: sqltypes.h:1034
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:388
int comp_param
Definition: sqltypes.h:1041
int dimension
Definition: sqltypes.h:1036

+ Here is the call graph for this function:

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

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

669  {
670  return type == rhs.get_type() && subtype == rhs.get_subtype() &&
671  dimension == rhs.get_dimension() && scale == rhs.get_scale() &&
672  compression == rhs.get_compression() &&
675  notnull == rhs.get_notnull() && dict_key_ == rhs.dict_key_;
676  }
HOST DEVICE SQLTypes get_subtype() const
Definition: sqltypes.h:382
shared::StringDictKey dict_key_
Definition: sqltypes.h:1048
HOST DEVICE int get_scale() const
Definition: sqltypes.h:386
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:381
SQLTypes subtype
Definition: sqltypes.h:1035
bool notnull
Definition: sqltypes.h:1039
EncodingType compression
Definition: sqltypes.h:1040
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:389
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:383
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:392
SQLTypes type
Definition: sqltypes.h:1034
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:388
#define TRANSIENT_DICT(ID)
Definition: sqltypes.h:312
int comp_param
Definition: sqltypes.h:1041
int dimension
Definition: sqltypes.h:1036

+ Here is the call graph for this function:

void SQLTypeInfo::set_comp_param ( int  p)
inline

Definition at line 505 of file sqltypes.h.

References comp_param.

Referenced by Analyzer::Expr::add_cast(), 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(), Parser::LocalQueryConnector::getColumnDescriptors(), boost::serialization::load(), 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().

505 { comp_param = p; }
int comp_param
Definition: sqltypes.h:1041

+ Here is the caller graph for this function:

void SQLTypeInfo::set_compression ( EncodingType  c)
inline

Definition at line 504 of file sqltypes.h.

References compression.

Referenced by Analyzer::Expr::add_cast(), 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(), Parser::LocalQueryConnector::getColumnDescriptors(), boost::serialization::load(), 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().

504 { compression = c; }
EncodingType compression
Definition: sqltypes.h:1040

+ Here is the caller graph for this function:

void SQLTypeInfo::set_dict_intersection ( )
inline

Definition at line 503 of file sqltypes.h.

References dict_intersection.

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

503 { dict_intersection = true; }
bool dict_intersection
Definition: sqltypes.h:1043

+ Here is the caller graph for this function:

void SQLTypeInfo::set_dimension ( int  d)
inline

Definition at line 495 of file sqltypes.h.

References dimension.

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

495 { dimension = d; }
int dimension
Definition: sqltypes.h:1036

+ Here is the caller graph for this function:

void SQLTypeInfo::set_fixed_size ( )
inline

Definition at line 502 of file sqltypes.h.

References get_storage_size(), and size.

Referenced by Analyzer::Expr::add_cast(), Parser::QuerySpec::analyze_group_by(), Analyzer::BinOper::common_numeric_type(), import_export::Importer::gdalToColumnDescriptorsGeo(), import_export::Importer::gdalToColumnDescriptorsRaster(), 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().

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

+ 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 499 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().

499 { 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
void SQLTypeInfo::setStorageSize ( )
inline

Definition at line 1019 of file sqltypes.h.

References get_storage_size(), and size.

Referenced by get_array_type(), and get_elem_type().

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

+ 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 1027 of file sqltypes.h.

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

Referenced by Analyzer::BinOper::common_string_type(), Parser::OperExpr::normalize(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::set_dict_key(), and type_info_from_thrift().

1027  {
1028  dict_key_ = dict_key;
1029  // If comp_param is set, it should equal dict_id.
1031  }
shared::StringDictKey dict_key_
Definition: sqltypes.h:1048
#define CHECK(condition)
Definition: Logger.h:291
int comp_param
Definition: sqltypes.h:1041

+ Here is the caller graph for this function:

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

Definition at line 547 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, and type_name.

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

547  {
548  std::ostringstream oss;
549  oss << "(type=" << type_name[static_cast<int>(type)]
550  << ", dimension=" << get_dimension() << ", scale=" << get_scale()
551  << ", null=" << (get_notnull() ? "not nullable" : "nullable")
552  << ", compression_name=" << get_compression_name()
553  << ", comp_param=" << get_comp_param()
554  << ", subtype=" << type_name[static_cast<int>(subtype)] << ", size=" << get_size()
555  << ", element_size=" << get_elem_type().get_size() << ", dict_key=" << dict_key_
556  << ")";
557  return oss.str();
558  }
HOST DEVICE int get_size() const
Definition: sqltypes.h:393
shared::StringDictKey dict_key_
Definition: sqltypes.h:1048
HOST DEVICE int get_scale() const
Definition: sqltypes.h:386
std::string get_compression_name() const
Definition: sqltypes.h:545
static std::string type_name[kSQLTYPE_LAST]
Definition: sqltypes.h:1045
SQLTypes subtype
Definition: sqltypes.h:1035
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:383
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:392
SQLTypes type
Definition: sqltypes.h:1034
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:388
SQLTypeInfo get_elem_type() const
Definition: sqltypes.h:963

+ 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 546 of file sqltypes.h.

References to_string().

Referenced by shared::convert_temporal_to_iso_format().

546 { return to_string(); } // for PRINT macro
std::string to_string() const
Definition: sqltypes.h:547

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SQLTypeInfo::transforms ( ) const
inline

Definition at line 615 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().

615  {
616  return IS_GEO(type) && get_input_srid() > 0 && get_output_srid() > 0 &&
618  }
HOST DEVICE int get_input_srid() const
Definition: sqltypes.h:385
SQLTypes type
Definition: sqltypes.h:1034
#define IS_GEO(T)
Definition: sqltypes.h:300
HOST DEVICE int get_output_srid() const
Definition: sqltypes.h:387

+ Here is the call graph for this function:

+ 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 1046 of file sqltypes.h.

Referenced by get_compression_name().

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

Definition at line 1043 of file sqltypes.h.

Referenced by is_dict_intersection(), and set_dict_intersection().

shared::StringDictKey SQLTypeInfo::dict_key_
private
bool SQLTypeInfo::notnull
private
std::string SQLTypeInfo::type_name
staticprivate

Definition at line 1045 of file sqltypes.h.

Referenced by get_type_name(), and to_string().


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