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

#include <sqltypes.h>

Public Member Functions

 SQLTypeInfo (SQLTypes t, int d, int s, bool n, EncodingType c, int p, SQLTypes st)
 
 SQLTypeInfo (SQLTypes t, int d, int s, bool n)
 
 SQLTypeInfo (SQLTypes t, 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
 
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_bytes () const
 
bool is_buffer () const
 
bool transforms () const
 
bool is_varlen () const
 
bool is_varlen_indeed () const
 
bool is_dict_encoded_string () const
 
bool is_none_encoded_string () const
 
bool is_subtype_dict_encoded_string () const
 
bool is_dict_encoded_type () const
 
bool is_dict_intersection () 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_high_precision_timestamp () const
 
bool is_timestamp () const
 

Private Member Functions

HOST DEVICE int get_storage_size () const
 

Private Attributes

SQLTypes type
 
SQLTypes subtype
 
int dimension
 
int scale
 
bool notnull
 
EncodingType compression
 
int comp_param
 
int size
 
bool dict_intersection {false}
 

Static Private Attributes

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

Detailed Description

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

273  : type(t)
274  , subtype(st)
275  , dimension(d)
276  , scale(s)
277  , notnull(n)
278  , compression(c)
279  , comp_param(p)
280  , size(get_storage_size()) {}
SQLTypes subtype
Definition: sqltypes.h:899
bool notnull
Definition: sqltypes.h:903
EncodingType compression
Definition: sqltypes.h:904
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:912
SQLTypes type
Definition: sqltypes.h:898
constexpr double n
Definition: Utm.h:38
int comp_param
Definition: sqltypes.h:905
int dimension
Definition: sqltypes.h:900
SQLTypeInfo::SQLTypeInfo ( SQLTypes  t,
int  d,
int  s,
bool  n 
)
inline

Definition at line 281 of file sqltypes.h.

282  : type(t)
283  , subtype(kNULLT)
284  , dimension(d)
285  , scale(s)
286  , notnull(n)
288  , comp_param(0)
289  , size(get_storage_size()) {}
SQLTypes subtype
Definition: sqltypes.h:899
bool notnull
Definition: sqltypes.h:903
EncodingType compression
Definition: sqltypes.h:904
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:912
SQLTypes type
Definition: sqltypes.h:898
constexpr double n
Definition: Utm.h:38
int comp_param
Definition: sqltypes.h:905
int dimension
Definition: sqltypes.h:900
SQLTypeInfo::SQLTypeInfo ( SQLTypes  t,
EncodingType  c,
int  p,
SQLTypes  st 
)
inline

Definition at line 290 of file sqltypes.h.

291  : type(t)
292  , subtype(st)
293  , dimension(0)
294  , scale(0)
295  , notnull(false)
296  , compression(c)
297  , comp_param(p)
298  , size(get_storage_size()) {}
SQLTypes subtype
Definition: sqltypes.h:899
bool notnull
Definition: sqltypes.h:903
EncodingType compression
Definition: sqltypes.h:904
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:912
SQLTypes type
Definition: sqltypes.h:898
int comp_param
Definition: sqltypes.h:905
int dimension
Definition: sqltypes.h:900
SQLTypeInfo::SQLTypeInfo ( SQLTypes  t,
int  d,
int  s 
)
inline

Definition at line 299 of file sqltypes.h.

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

Definition at line 300 of file sqltypes.h.

301  : type(t)
302  , subtype(kNULLT)
303  , dimension(0)
304  , scale(0)
305  , notnull(n)
307  , comp_param(0)
308  , size(get_storage_size()) {}
SQLTypes subtype
Definition: sqltypes.h:899
bool notnull
Definition: sqltypes.h:903
EncodingType compression
Definition: sqltypes.h:904
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:912
SQLTypes type
Definition: sqltypes.h:898
constexpr double n
Definition: Utm.h:38
int comp_param
Definition: sqltypes.h:905
int dimension
Definition: sqltypes.h:900
SQLTypeInfo::SQLTypeInfo ( SQLTypes  t)
inline

Definition at line 309 of file sqltypes.h.

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

Definition at line 310 of file sqltypes.h.

311  : type(t)
312  , subtype(kNULLT)
313  , dimension(0)
314  , scale(0)
315  , notnull(n)
316  , compression(c)
317  , comp_param(0)
318  , size(get_storage_size()) {}
SQLTypes subtype
Definition: sqltypes.h:899
bool notnull
Definition: sqltypes.h:903
EncodingType compression
Definition: sqltypes.h:904
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:912
SQLTypes type
Definition: sqltypes.h:898
constexpr double n
Definition: Utm.h:38
int comp_param
Definition: sqltypes.h:905
int dimension
Definition: sqltypes.h:900
SQLTypeInfo::SQLTypeInfo ( )
inline

Definition at line 319 of file sqltypes.h.

Referenced by get_array_type(), and get_elem_type().

320  : type(kNULLT)
321  , subtype(kNULLT)
322  , dimension(0)
323  , scale(0)
324  , notnull(false)
326  , comp_param(0)
327  , size(0) {}
SQLTypes subtype
Definition: sqltypes.h:899
bool notnull
Definition: sqltypes.h:903
EncodingType compression
Definition: sqltypes.h:904
SQLTypes type
Definition: sqltypes.h:898
int comp_param
Definition: sqltypes.h:905
int dimension
Definition: sqltypes.h:900

+ Here is the caller graph for this function:

Member Function Documentation

int SQLTypeInfo::get_array_context_logical_size ( ) const
inline

Definition at line 584 of file sqltypes.h.

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

Referenced by ResultSet::makeVarlenTargetValue().

584  {
585  if (is_string()) {
586  auto comp_type(get_compression());
587  if (comp_type == kENCODING_DICT || comp_type == kENCODING_FIXED ||
588  comp_type == kENCODING_NONE) {
589  return sizeof(int32_t);
590  }
591  }
592  return get_logical_size();
593  }
int get_logical_size() const
Definition: sqltypes.h:349
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:337
bool is_string() const
Definition: sqltypes.h:510

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

References comp_param, compression, dimension, kARRAY, notnull, scale, SQLTypeInfo(), and type.

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

869  {
871  }
bool notnull
Definition: sqltypes.h:903
EncodingType compression
Definition: sqltypes.h:904
SQLTypes type
Definition: sqltypes.h:898
int comp_param
Definition: sqltypes.h:905
int dimension
Definition: sqltypes.h:900

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

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

494  {
495  if (is_array()) {
496  return "Array";
497  }
498  if (is_bytes()) {
499  return "Bytes";
500  }
501 
502  if (is_column()) {
503  return "Column";
504  }
505 
506  assert(false);
507  return "";
508  }
bool is_column() const
Definition: sqltypes.h:523
bool is_bytes() const
Definition: sqltypes.h:525
bool is_array() const
Definition: sqltypes.h:518

+ Here is the call graph for this function:

HOST DEVICE int SQLTypeInfo::get_comp_param ( ) const
inline

Definition at line 338 of file sqltypes.h.

References comp_param.

Referenced by Analyzer::Expr::add_cast(), Analyzer::UOper::add_cast(), Analyzer::CaseExpr::add_cast(), Catalog_Namespace::Catalog::addColumn(), Catalog_Namespace::Catalog::addReferenceToForeignDict(), bind_function(), CodeGenerator::codegenCastFromString(), CodeGenerator::codegenCompression(), CodeGenerator::codegenPseudoStringOper(), Parser::common_string_type(), Analyzer::BinOper::common_string_type(), import_export::ImporterUtils::composeNullPointCoords(), Geospatial::compress_coord(), Geospatial::compress_coords(), Geospatial::compress_null_point(), DictionaryConverterFactory< TARGET_TYPE >::create(), Encoder::Create(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::create_parquet_decimal_encoder(), Catalog_Namespace::Catalog::createTable(), DateDaysOverflowValidator::DateDaysOverflowValidator(), decompress(), Catalog_Namespace::Catalog::delDictionary(), DictionaryValueConverter< TARGET_TYPE >::DictionaryValueConverter(), Catalog_Namespace::Catalog::doTruncateTable(), import_export::fill_missing_columns(), Catalog_Namespace::Catalog::gatherAdditionalInfo(), Analyzer::ColumnVar::get_comp_param(), Geospatial::get_compression_scheme(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), get_logical_type_info(), Parser::get_str_dict_cast_type(), Catalog_Namespace::Catalog::getColumnDictDirectory(), Catalog_Namespace::Catalog::getDictionaryToColumnMapping(), ArrowResultSetConverter::initializeColumnBuilder(), inline_fixed_encoding_null_val(), anonymous_namespace{RelAlgExecutor.cpp}::insert_one_dict_str(), Geospatial::is_null_point(), foreign_storage::ParquetDataWrapper::loadBuffersUsingLazyParquetChunkLoader(), Parser::OperExpr::normalize(), operator!=(), TextConverterFactory::operator()(), operator=(), operator==(), anonymous_namespace{Datum.cpp}::parseInteger(), DBHandler::populateThriftColumnType(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), Catalog_Namespace::Catalog::removeTableFromMap(), Catalog_Namespace::Catalog::setColumnDictionary(), Catalog_Namespace::Catalog::setColumnSharedDictionary(), to_string(), Analyzer::UOper::toString(), translate_dict_strings(), 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(), TransientDictIdVisitor::visitCaseExpr(), TransientDictIdVisitor::visitStringOper(), TransientDictIdVisitor::visitUOper(), and File_Namespace::FileBuffer::writeMetadata().

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

Definition at line 337 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(), bind_function(), CodeGenerator::castArrayPointer(), ChunkIter_get_next(), ChunkIter_get_nth(), import_export::TypedImportBuffer::clear(), spatial_type::NPoints::codegen(), TargetExprCodegen::codegenAggregate(), CodeGenerator::codegenCastFromString(), 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(), 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(), 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(), Parser::get_str_dict_cast_type(), Parser::LocalQueryConnector::getColumnDescriptors(), Catalog_Namespace::Catalog::getColumnDictDirectory(), Chunk_NS::Chunk::getNumElemsForBytesInsertData(), import_export::Loader::getStringDict(), ResultSet::getTargetValueFromBufferRowwise(), Chunk_NS::Chunk::initEncoder(), inline_fixed_encoding_null_val(), inline_int_null_val(), CgenState::inlineIntNull(), is_bytes(), is_date_in_days(), FixedLengthArrayNoneEncoder::is_null_ignore_not_null(), Geospatial::is_null_point(), is_real_str_or_array(), is_unsigned_type(), RangeJoinHashTable::isInnerColCompressed(), 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::removeTableFromMap(), anonymous_namespace{TableOptimizer.cpp}::set_metadata_from_results(), Chunk_NS::Chunk::setChunkBuffer(), Fragmenter_Namespace::size_of_raw_column(), RelAlgTranslator::translateBinaryGeoFunction(), RelAlgTranslator::translateGeoFunctionArg(), RelAlgTranslator::translateGeoLiteral(), import_export::TypedImportBuffer::TypedImportBuffer(), ExpressionRange::typeSupportsRange(), FixedLengthArrayNoneEncoder::update_elem_stats(), ArrayNoneEncoder::update_elem_stats(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), anonymous_namespace{InputMetadata.cpp}::uses_int_meta(), foreign_storage::ParquetDateInSecondsEncoder< 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().

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

Definition at line 481 of file sqltypes.h.

References comp_name, and compression.

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

481 { return comp_name[(int)compression]; }
EncodingType compression
Definition: sqltypes.h:904
static std::string comp_name[kENCODING_LAST]
Definition: sqltypes.h:910

+ Here is the caller graph for this function:

HOST DEVICE int SQLTypeInfo::get_dimension ( ) const
inline

Definition at line 331 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::codegenDateTruncHighPrecisionTimestamps(), CodeGenerator::codegenExtractHighPrecisionTimestamps(), 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(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), anonymous_namespace{Execute.cpp}::get_hpt_overflow_underflow_safe_scaled_values(), get_logical_type_info(), 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!=(), operator=(), operator==(), parse_numeric(), Parser::InsertIntoTableAsSelectStmt::populateData(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), StringToDatum(), to_string(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_timestamp_mapping(), and File_Namespace::FileBuffer::writeMetadata().

331 { return dimension; }
int dimension
Definition: sqltypes.h:900

+ Here is the caller graph for this function:

SQLTypeInfo SQLTypeInfo::get_elem_type ( ) const
inline

Definition at line 865 of file sqltypes.h.

References comp_param, compression, dimension, kNULLT, notnull, scale, SQLTypeInfo(), and subtype.

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(), ArrayConverterFactory< ELEMENT_FACTORY >::create(), foreign_storage::ParquetEncoder::createMetadata(), DateDaysOverflowValidator::DateDaysOverflowValidator(), DecimalOverflowValidator::DecimalOverflowValidator(), Analyzer::Constant::do_cast(), ChunkMetadata::dump(), RelAlgExecutor::executeSimpleInsert(), get_bit_width(), anonymous_namespace{ExtensionsIR.cpp}::get_llvm_type_from_sql_array_type(), foreign_storage::get_placeholder_metadata(), foreign_storage::Csv::get_placeholder_metadata(), foreign_storage::get_sub_type_column_descriptor(), get_type_name(), getLeafColumnRange(), foreign_storage::TypedParquetInPlaceEncoder< V, V >::getRowGroupMetadata(), foreign_storage::ParquetArrayEncoder::initializeErrorTracking(), 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()(), 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(), 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().

865  {
866  return SQLTypeInfo(
868  }
SQLTypes subtype
Definition: sqltypes.h:899
bool notnull
Definition: sqltypes.h:903
EncodingType compression
Definition: sqltypes.h:904
int comp_param
Definition: sqltypes.h:905
int dimension
Definition: sqltypes.h:900

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

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

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

349  {
352  return ti.get_size();
353  }
354  if (compression == kENCODING_DICT) {
355  return 4;
356  }
357  return get_size();
358  }
HOST DEVICE int get_size() const
Definition: sqltypes.h:339
SQLTypes subtype
Definition: sqltypes.h:899
bool notnull
Definition: sqltypes.h:903
EncodingType compression
Definition: sqltypes.h:904
SQLTypes type
Definition: sqltypes.h:898
int dimension
Definition: sqltypes.h:900

+ 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 336 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::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(), GroupByAndAggregate::codegenApproxQuantile(), CodeGenerator::codegenCast(), CodeGenerator::codegenCastBetweenIntTypes(), CodeGenerator::codegenCastBetweenIntTypesOverflowChecks(), CodeGenerator::codegenCastFromFp(), CodeGenerator::codegenCastToFp(), CodeGenerator::codegenDateTruncHighPrecisionTimestamps(), CodeGenerator::codegenDiv(), CodeGenerator::codegenExtractHighPrecisionTimestamps(), CodeGenerator::codegenGeoArrayLoadAndNullcheck(), 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_logical_type_info(), get_null_check_suffix(), get_target_info(), Fragmenter_Namespace::get_var_len_null_array_indexes(), 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(), GeoTargetValueSerializer< kPOINT >::serialize(), GeoWktSerializer< kPOINT >::serialize(), GeoTargetValuePtrSerializer< kPOINT >::serialize(), GeoTargetValueSerializer< kLINESTRING >::serialize(), GeoWktSerializer< kLINESTRING >::serialize(), GeoTargetValuePtrSerializer< kLINESTRING >::serialize(), GeoTargetValueSerializer< kPOLYGON >::serialize(), GeoWktSerializer< kPOLYGON >::serialize(), GeoTargetValuePtrSerializer< kPOLYGON >::serialize(), GeoTargetValueSerializer< kMULTIPOLYGON >::serialize(), GeoWktSerializer< kMULTIPOLYGON >::serialize(), GeoTargetValuePtrSerializer< kMULTIPOLYGON >::serialize(), Fragmenter_Namespace::set_chunk_stats(), anonymous_namespace{ResultSetReductionJIT.cpp}::target_info_key(), 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().

336 { return notnull; }
bool notnull
Definition: sqltypes.h:903
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 713 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().

713  {
714  CHECK(type == kBOOLEAN || type == kTINYINT || type == kSMALLINT || type == kINT ||
715  type == kBIGINT || type == kFLOAT || type == kDOUBLE || type == kDECIMAL ||
716  type == kNUMERIC || type == kTIMESTAMP || type == kDATE || type == kTIME);
717  switch (type) {
718  case kBOOLEAN:
719  return 1;
720  case kTINYINT:
721  case kSMALLINT:
722  case kINT:
723  case kBIGINT:
724  case kFLOAT:
725  case kDOUBLE:
726  return get_logical_size();
727  case kDECIMAL:
728  case kNUMERIC:
729  if (get_dimension() > 7) {
730  return 8;
731  } else {
732  return 4;
733  }
734  case kTIMESTAMP:
735  switch (get_dimension()) {
736  case 9:
737  return 8;
738  case 6:
739  return 4;
740  case 3:
741  return 2;
742  case 0:
743  return 1;
744  default:
745  UNREACHABLE();
746  }
747  case kDATE:
748  return 1;
749  case kTIME:
750  return 1;
751  default:
752  UNREACHABLE();
753  return 0;
754  }
755  }
Definition: sqltypes.h:49
#define UNREACHABLE()
Definition: Logger.h:267
int get_logical_size() const
Definition: sqltypes.h:349
Definition: sqltypes.h:53
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:331
#define CHECK(condition)
Definition: Logger.h:223
SQLTypes type
Definition: sqltypes.h:898
Definition: sqltypes.h:45

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

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

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

360  {
361  switch (type) {
362  case kPOINT:
363  return 1; // coords
364  case kLINESTRING:
365  return 2; // coords, bounds
366  case kPOLYGON:
367  return 4; // coords, ring_sizes, bounds, render_group
368  case kMULTIPOLYGON:
369  return 5; // coords, ring_sizes, poly_rings, bounds, render_group
370  default:
371  break;
372  }
373  return 0;
374  }
SQLTypes type
Definition: sqltypes.h:898

+ Here is the caller graph for this function:

int SQLTypeInfo::get_physical_coord_cols ( ) const
inline

Definition at line 375 of file sqltypes.h.

References kLINESTRING, 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().

375  {
376  // @TODO dmitri/simon rename this function?
377  // It needs to return the number of extra columns
378  // which need to go through the executor, as opposed
379  // to those which are only needed by CPU for poly
380  // cache building or what-not. For now, we just omit
381  // the Render Group column. If we add Bounding Box
382  // or something this may require rethinking. Perhaps
383  // these two functions need to return an array of
384  // offsets rather than just a number to loop over,
385  // so that executor and non-executor columns can
386  // be mixed.
387  // NOTE(adb): In binding to extension functions, we need to know some pretty specific
388  // type info about each of the physical coords cols for each geo type. I added checks
389  // there to ensure the physical coords col for the geo type match what we expect. If
390  // these values are ever changed, corresponding values in
391  // ExtensionFunctionsBinding.cpp::compute_narrowing_conv_scores and
392  // ExtensionFunctionsBinding.cpp::compute_widening_conv_scores will also need to be
393  // changed.
394  switch (type) {
395  case kPOINT:
396  return 1;
397  case kLINESTRING:
398  return 1; // omit bounds
399  case kPOLYGON:
400  return 2; // omit bounds, render group
401  case kMULTIPOLYGON:
402  return 3; // omit bounds, render group
403  default:
404  break;
405  }
406  return 0;
407  }
SQLTypes type
Definition: sqltypes.h:898

+ Here is the caller graph for this function:

HOST DEVICE int SQLTypeInfo::get_scale ( ) const
inline

Definition at line 334 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::codegenCastToFp(), CodeGenerator::codegenCmpDecimalConst(), CodeGenerator::codegenDiv(), CodeGenerator::codgenAdjustFixedEncNull(), Analyzer::BinOper::common_numeric_type(), convert_decimal_value_to_scale(), Catalog_Namespace::Catalog::createTable(), DatumToString(), anonymous_namespace{TypedDataAccessors.h}::decimal_to_double(), DecimalOverflowValidator::DecimalOverflowValidator(), Analyzer::Expr::decompress(), anonymous_namespace{ArrowResultSetConverter.cpp}::get_arrow_type(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), get_logical_type_info(), getArrowImportType(), anonymous_namespace{RelAlgTranslator.cpp}::makeNumericConstant(), HashJoin::normalizeColumnPair(), operator!=(), operator=(), operator==(), pair_to_double(), parse_numeric(), Parser::InsertIntoTableAsSelectStmt::populateData(), DBHandler::populateThriftColumnType(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), anonymous_namespace{ExpressionRange.cpp}::scale_up_interval_endpoint(), 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().

334 { return scale; }

+ Here is the caller graph for this function:

HOST DEVICE int SQLTypeInfo::get_size ( ) const
inline

Definition at line 339 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(), 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(), CodeGenerator::codegenMul(), CodeGenerator::codegenSub(), CodeGenerator::codgenAdjustFixedEncNull(), 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{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(), 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(), Fragmenter_Namespace::size_of_raw_column(), string_dict_to_int_type(), import_export::StringToArray(), import_export::TDatumToArrayDatum(), to_string(), 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().

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

Definition at line 912 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, kMULTIPOLYGON, kNUMERIC, kPOINT, kPOLYGON, kSMALLINT, kTEXT, kTIME, kTIMESTAMP, kTINYINT, kVARCHAR, and type.

Referenced by set_fixed_size().

912  {
913  switch (type) {
914  case kBOOLEAN:
915  return sizeof(int8_t);
916  case kTINYINT:
917  return sizeof(int8_t);
918  case kSMALLINT:
919  switch (compression) {
920  case kENCODING_NONE:
921  return sizeof(int16_t);
922  case kENCODING_FIXED:
923  case kENCODING_SPARSE:
924  return comp_param / 8;
925  case kENCODING_RL:
926  case kENCODING_DIFF:
927  break;
928  default:
929  assert(false);
930  }
931  break;
932  case kINT:
933  switch (compression) {
934  case kENCODING_NONE:
935  return sizeof(int32_t);
936  case kENCODING_FIXED:
937  case kENCODING_SPARSE:
938  case kENCODING_GEOINT:
939  return comp_param / 8;
940  case kENCODING_RL:
941  case kENCODING_DIFF:
942  break;
943  default:
944  assert(false);
945  }
946  break;
947  case kBIGINT:
948  case kNUMERIC:
949  case kDECIMAL:
950  switch (compression) {
951  case kENCODING_NONE:
952  return sizeof(int64_t);
953  case kENCODING_FIXED:
954  case kENCODING_SPARSE:
955  return comp_param / 8;
956  case kENCODING_RL:
957  case kENCODING_DIFF:
958  break;
959  default:
960  assert(false);
961  }
962  break;
963  case kFLOAT:
964  switch (compression) {
965  case kENCODING_NONE:
966  return sizeof(float);
967  case kENCODING_FIXED:
968  case kENCODING_RL:
969  case kENCODING_DIFF:
970  case kENCODING_SPARSE:
971  assert(false);
972  break;
973  default:
974  assert(false);
975  }
976  break;
977  case kDOUBLE:
978  switch (compression) {
979  case kENCODING_NONE:
980  return sizeof(double);
981  case kENCODING_FIXED:
982  case kENCODING_RL:
983  case kENCODING_DIFF:
984  case kENCODING_SPARSE:
985  assert(false);
986  break;
987  default:
988  assert(false);
989  }
990  break;
991  case kTIMESTAMP:
992  case kTIME:
993  case kINTERVAL_DAY_TIME:
995  case kDATE:
996  switch (compression) {
997  case kENCODING_NONE:
998  return sizeof(int64_t);
999  case kENCODING_FIXED:
1000  if (type == kTIMESTAMP && dimension > 0) {
1001  assert(false); // disable compression for timestamp precisions
1002  }
1003  return comp_param / 8;
1004  case kENCODING_RL:
1005  case kENCODING_DIFF:
1006  case kENCODING_SPARSE:
1007  assert(false);
1008  break;
1010  switch (comp_param) {
1011  case 0:
1012  return 4; // Default date encoded in days is 32 bits
1013  case 16:
1014  case 32:
1015  return comp_param / 8;
1016  default:
1017  assert(false);
1018  break;
1019  }
1020  default:
1021  assert(false);
1022  }
1023  break;
1024  case kTEXT:
1025  case kVARCHAR:
1026  case kCHAR:
1027  if (compression == kENCODING_DICT) {
1028  return sizeof(int32_t); // @TODO(wei) must check DictDescriptor
1029  }
1030  break;
1031  case kARRAY:
1032  // TODO: return size for fixlen arrays?
1033  break;
1034  case kPOINT:
1035  case kLINESTRING:
1036  case kPOLYGON:
1037  case kMULTIPOLYGON:
1038  case kCOLUMN:
1039  case kCOLUMN_LIST:
1040  break;
1041  default:
1042  break;
1043  }
1044  return -1;
1045  }
Definition: sqltypes.h:49
EncodingType compression
Definition: sqltypes.h:904
Definition: sqltypes.h:52
Definition: sqltypes.h:53
Definition: sqltypes.h:41
SQLTypes type
Definition: sqltypes.h:898
Definition: sqltypes.h:45
int comp_param
Definition: sqltypes.h:905
int dimension
Definition: sqltypes.h:900

+ Here is the caller graph for this function:

HOST DEVICE SQLTypes SQLTypeInfo::get_subtype ( ) const
inline

Definition at line 330 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(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), get_logical_type_info(), ColumnDescriptor::getDefaultValueLiteral(), import_export::Loader::getStringDict(), 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(), 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().

330 { return subtype; }
SQLTypes subtype
Definition: sqltypes.h:899

+ Here is the caller graph for this function:

HOST DEVICE SQLTypes SQLTypeInfo::get_type ( ) const
inline

Definition at line 329 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(), 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(), TargetExprCodegen::codegenAggregate(), CodeGenerator::codegenCast(), CodeGenerator::codegenCastFromFp(), 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(), 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(), anonymous_namespace{ExpressionRange.cpp}::fpRangeFromDecimal(), 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{ArrowResultSetConverter.cpp}::get_physical_type(), anonymous_namespace{TypedDataAccessors.h}::get_scalar(), import_export::anonymous_namespace{Importer.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::hasRingSizesColumn(), 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(), 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!=(), 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(), 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(), 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().

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

Definition at line 443 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(), ChunkMetadata::dump(), 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(), 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().

443  {
444  if (IS_GEO(type)) {
445  std::string srid_string = "";
446  if (get_output_srid() > 0) {
447  srid_string = ", " + std::to_string(get_output_srid());
448  }
449  CHECK_LT(static_cast<int>(subtype), kSQLTYPE_LAST);
450  return type_name[static_cast<int>(subtype)] + "(" +
451  type_name[static_cast<int>(type)] + srid_string + ")";
452  }
453  std::string ps = "";
454  if (type == kDECIMAL || type == kNUMERIC) {
455  ps = "(" + std::to_string(dimension) + "," + std::to_string(scale) + ")";
456  } else if (type == kTIMESTAMP) {
457  ps = "(" + std::to_string(dimension) + ")";
458  }
459  if (type == kARRAY) {
460  auto elem_ti = get_elem_type();
461  auto num_elems = (size > 0) ? std::to_string(size / elem_ti.get_size()) : "";
462  CHECK_LT(static_cast<int>(subtype), kSQLTYPE_LAST);
463  return elem_ti.get_type_name() + ps + "[" + num_elems + "]";
464  }
465  if (type == kCOLUMN) {
466  auto elem_ti = get_elem_type();
467  auto num_elems =
468  (size > 0) ? "[" + std::to_string(size / elem_ti.get_size()) + "]" : "";
469  CHECK_LT(static_cast<int>(subtype), kSQLTYPE_LAST);
470  return "COLUMN<" + type_name[static_cast<int>(subtype)] + ps + ">" + num_elems;
471  }
472  if (type == kCOLUMN_LIST) {
473  auto elem_ti = get_elem_type();
474  auto num_elems =
475  (size > 0) ? "[" + std::to_string(size / elem_ti.get_size()) + "]" : "";
476  CHECK_LT(static_cast<int>(subtype), kSQLTYPE_LAST);
477  return "COLUMN_LIST<" + type_name[static_cast<int>(subtype)] + ps + ">" + num_elems;
478  }
479  return type_name[static_cast<int>(type)] + ps;
480  }
std::string to_string(char const *&&v)
static std::string type_name[kSQLTYPE_LAST]
Definition: sqltypes.h:909
SQLTypes subtype
Definition: sqltypes.h:899
#define CHECK_LT(x, y)
Definition: Logger.h:233
SQLTypes type
Definition: sqltypes.h:898
size_t num_elems
SQLTypeInfo get_elem_type() const
Definition: sqltypes.h:865
#define IS_GEO(T)
Definition: sqltypes.h:251
int dimension
Definition: sqltypes.h:900
HOST DEVICE int get_output_srid() const
Definition: sqltypes.h:335

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SQLTypeInfo::has_bounds ( ) const
inline

Definition at line 408 of file sqltypes.h.

References kLINESTRING, kMULTIPOLYGON, kPOLYGON, and type.

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

408  {
409  switch (type) {
410  case kLINESTRING:
411  case kPOLYGON:
412  case kMULTIPOLYGON:
413  return true;
414  default:
415  break;
416  }
417  return false;
418  }
SQLTypes type
Definition: sqltypes.h:898

+ Here is the caller graph for this function:

bool SQLTypeInfo::has_render_group ( ) const
inline

Definition at line 419 of file sqltypes.h.

References kMULTIPOLYGON, kPOLYGON, and type.

Referenced by RelAlgTranslator::translateGeoColumn().

419  {
420  switch (type) {
421  case kPOLYGON:
422  case kMULTIPOLYGON:
423  return true;
424  default:
425  break;
426  }
427  return false;
428  }
SQLTypes type
Definition: sqltypes.h:898

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_array ( ) const
inline

Definition at line 518 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(), ChunkMetadata::dump(), get_buffer_name(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), foreign_storage::get_placeholder_metadata(), foreign_storage::Csv::get_placeholder_metadata(), Parser::LocalQueryConnector::getColumnDescriptors(), ColumnDescriptor::getDefaultValueLiteral(), getLeafColumnRange(), foreign_storage::TypedParquetInPlaceEncoder< V, V >::getRowGroupMetadata(), ResultSet::getTargetValueFromBufferRowwise(), foreign_storage::TypedParquetInPlaceEncoder< V, V >::getUpdatedStats(), CodeGenerator::hashJoinLhs(), 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(), Executor::needLinearizeAllFragments(), null_val_bit_pattern(), NullAwareValidator< INNER_VALIDATOR >::NullAwareValidator(), 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(), 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().

518 { return type == kARRAY; } // rbc Array
SQLTypes type
Definition: sqltypes.h:898

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_buffer ( ) const
inline

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

528  {
529  return is_array() || is_column() || is_column_list() || is_bytes();
530  }
bool is_column() const
Definition: sqltypes.h:523
bool is_bytes() const
Definition: sqltypes.h:525
bool is_column_list() const
Definition: sqltypes.h:524
bool is_array() const
Definition: sqltypes.h:518

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

525  {
526  return type == kTEXT && get_compression() == kENCODING_NONE;
527  } // rbc Bytes
Definition: sqltypes.h:52
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:337
SQLTypes type
Definition: sqltypes.h:898

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

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

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

606  {
607  // can always cast between the same type but different precision/scale/encodings
608  if (type == new_type_info.get_type()) {
609  return true;
610  // can always cast between strings
611  } else if (is_string() && new_type_info.is_string()) {
612  return true;
613  } else if (is_string() && !new_type_info.is_string()) {
614  return false;
615  } else if (!is_string() && new_type_info.is_string()) {
616  return false;
617  // can cast between numbers
618  } else if (is_number() && new_type_info.is_number()) {
619  return true;
620  // can cast from timestamp or date to number (epoch)
621  } else if ((type == kTIMESTAMP || type == kDATE) && new_type_info.is_number()) {
622  return true;
623  // can cast from number (epoch) to timestamp, date, or time
624  } else if (is_number() && new_type_info.is_time()) {
625  return true;
626  // can cast from date to timestamp
627  } else if (type == kDATE && new_type_info.get_type() == kTIMESTAMP) {
628  return true;
629  } else if (type == kTIMESTAMP && new_type_info.get_type() == kDATE) {
630  return true;
631  } else if (type == kBOOLEAN && new_type_info.is_number()) {
632  return true;
633  } else if (type == kARRAY && new_type_info.get_type() == kARRAY) {
634  return get_elem_type().is_castable(new_type_info.get_elem_type());
635  } else if (type == kCOLUMN && new_type_info.get_type() == kCOLUMN) {
636  return get_elem_type().is_castable(new_type_info.get_elem_type());
637  } else if (type == kCOLUMN_LIST && new_type_info.get_type() == kCOLUMN_LIST) {
638  return get_elem_type().is_castable(new_type_info.get_elem_type());
639  } else {
640  return false;
641  }
642  }
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:329
bool is_number() const
Definition: sqltypes.h:515
bool is_time() const
Definition: sqltypes.h:516
bool is_castable(const SQLTypeInfo &new_type_info) const
Definition: sqltypes.h:606
Definition: sqltypes.h:53
SQLTypes type
Definition: sqltypes.h:898
bool is_string() const
Definition: sqltypes.h:510
SQLTypeInfo get_elem_type() const
Definition: sqltypes.h:865

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

References kCOLUMN, and type.

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

523 { return type == kCOLUMN; } // rbc Column
SQLTypes type
Definition: sqltypes.h:898

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_column_list ( ) const
inline

Definition at line 524 of file sqltypes.h.

References kCOLUMN_LIST, and type.

Referenced by is_buffer().

524 { return type == kCOLUMN_LIST; } // rbc ColumnList
SQLTypes type
Definition: sqltypes.h:898

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_date_in_days ( ) const
inline

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

873  {
874  if (type == kDATE) {
875  const auto comp_type = get_compression();
876  if (comp_type == kENCODING_DATE_IN_DAYS) {
877  return true;
878  }
879  }
880  return false;
881  }
Definition: sqltypes.h:53
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:337
SQLTypes type
Definition: sqltypes.h:898

+ 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 513 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(), CodeGenerator::checkExpressionRanges(), CodeGenerator::codegenAdd(), CodeGenerator::codegenCast(), CodeGenerator::codegenCastBetweenIntTypes(), CodeGenerator::codegenCastFromFp(), CodeGenerator::codegenCmp(), CodeGenerator::codegenDiv(), CodeGenerator::codegenFunctionOperWithCustomTypeHandling(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codegenMul(), CodeGenerator::codegenSub(), 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(), inline_fixed_encoding_null_val(), foreign_storage::TypedParquetInPlaceEncoder< V, V >::isIntegralType(), HashJoin::normalizeColumnPair(), numeric_type_name(), pair_to_double(), import_export::TypedImportBuffer::pop_value(), Parser::InsertIntoTableAsSelectStmt::populateData(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), 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().

513 { return type == kDECIMAL || type == kNUMERIC; }
SQLTypes type
Definition: sqltypes.h:898

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_dict_encoded_string ( ) const
inline

Definition at line 548 of file sqltypes.h.

References compression, is_string(), and kENCODING_DICT.

Referenced by ArrowResultSetConverter::append(), append_datum(), RelLogicalUnion::checkForMatchingMetaInfoTypes(), Parser::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(), import_export::anonymous_namespace{Importer.cpp}::get_type_for_datum(), 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(), and Fragmenter_Namespace::InsertOrderFragmenter::updateChunkStats().

548  {
549  return is_string() && compression == kENCODING_DICT;
550  }
EncodingType compression
Definition: sqltypes.h:904
bool is_string() const
Definition: sqltypes.h:510

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

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

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

560  {
561  return is_dict_encoded_string() ||
563  }
bool is_dict_encoded_string() const
Definition: sqltypes.h:548
SQLTypeInfo get_elem_type() const
Definition: sqltypes.h:865
bool is_array() const
Definition: sqltypes.h:518

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

References dict_intersection.

Referenced by CodeGenerator::codegenCastFromString().

565 { return dict_intersection; }
bool dict_intersection
Definition: sqltypes.h:907

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_fixlen_array ( ) const
inline

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

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

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_fp ( ) const
inline

Definition at line 514 of file sqltypes.h.

References kDOUBLE, kFLOAT, and type.

Referenced by Analyzer::Constant::add_cast(), Executor::castToFP(), CodeGenerator::codegenCastFromFp(), CodeGenerator::codegenCastToFp(), CodeGenerator::codegenDiv(), CodeGenerator::codegenFixedLengthColVarInWindow(), CodeGenerator::codegenIsNullNumber(), GroupByAndAggregate::convertNullIfAny(), anonymous_namespace{ArrowResultSetConverter.cpp}::create_or_append_validity(), anonymous_namespace{ExpressionRange.cpp}::fpRangeFromDecimal(), get_agg_initial_val(), anonymous_namespace{TableFunctionCompilationContext.cpp}::get_llvm_type_from_sql_column_type(), foreign_storage::FloatPointValidator< T >::getMinMaxBoundsAsStrings(), StorageIOFacility::getRsBufferNoPadding(), inline_fp_null_val(), anonymous_namespace{Execute.cpp}::inline_null_val(), CgenState::inlineFpNull(), 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(), 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().

514 { return type == kFLOAT || type == kDOUBLE; }
SQLTypes type
Definition: sqltypes.h:898

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_geometry ( ) const
inline

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

522 { return IS_GEO(type); }
SQLTypes type
Definition: sqltypes.h:898
#define IS_GEO(T)
Definition: sqltypes.h:251

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_high_precision_timestamp ( ) const
inline

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

885  {
886  if (type == kTIMESTAMP) {
887  const auto dimension = get_dimension();
888  if (dimension > 0) {
889  return true;
890  }
891  }
892  return false;
893  }
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:331
SQLTypes type
Definition: sqltypes.h:898
int dimension
Definition: sqltypes.h:900

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

References IS_INTEGER, and type.

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

512 { return IS_INTEGER(type); }
#define IS_INTEGER(T)
Definition: sqltypes.h:245
SQLTypes type
Definition: sqltypes.h:898

+ Here is the caller graph for this function:

int SQLTypeInfo::is_logical_geo_type ( ) const
inline

Definition at line 341 of file sqltypes.h.

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

341  {
342  if (type == kPOINT || type == kLINESTRING || type == kPOLYGON ||
343  type == kMULTIPOLYGON) {
344  return true;
345  }
346  return false;
347  }
SQLTypes type
Definition: sqltypes.h:898
bool SQLTypeInfo::is_none_encoded_string ( ) const
inline

Definition at line 552 of file sqltypes.h.

References compression, is_string(), and kENCODING_NONE.

Referenced by Parser::common_string_type().

552  {
553  return is_string() && compression == kENCODING_NONE;
554  }
EncodingType compression
Definition: sqltypes.h:904
bool is_string() const
Definition: sqltypes.h:510

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

757  {
758  // assuming Datum is always uncompressed
759  switch (type) {
760  case kBOOLEAN:
761  return (int8_t)d.boolval == NULL_BOOLEAN;
762  case kTINYINT:
763  return d.tinyintval == NULL_TINYINT;
764  case kSMALLINT:
765  return d.smallintval == NULL_SMALLINT;
766  case kINT:
767  return d.intval == NULL_INT;
768  case kBIGINT:
769  case kNUMERIC:
770  case kDECIMAL:
771  return d.bigintval == NULL_BIGINT;
772  case kFLOAT:
773  return d.floatval == NULL_FLOAT;
774  case kDOUBLE:
775  return d.doubleval == NULL_DOUBLE;
776  case kTIME:
777  case kTIMESTAMP:
778  case kDATE:
779  return d.bigintval == NULL_BIGINT;
780  case kTEXT:
781  case kVARCHAR:
782  case kCHAR:
783  // @TODO handle null strings
784  break;
785  case kNULLT:
786  return true;
787  case kARRAY:
788  return d.arrayval == NULL || d.arrayval->is_null;
789  default:
790  break;
791  }
792  return false;
793  }
int8_t tinyintval
Definition: sqltypes.h:212
#define NULL_DOUBLE
Definition: sqltypes.h:49
#define NULL_FLOAT
bool is_null
Definition: sqltypes.h:153
#define NULL_BIGINT
int8_t boolval
Definition: sqltypes.h:211
VarlenDatum * arrayval
Definition: sqltypes.h:218
int32_t intval
Definition: sqltypes.h:214
#define NULL_INT
float floatval
Definition: sqltypes.h:216
int64_t bigintval
Definition: sqltypes.h:215
int16_t smallintval
Definition: sqltypes.h:213
#define NULL_BOOLEAN
Definition: sqltypes.h:52
Definition: sqltypes.h:53
Definition: sqltypes.h:41
#define NULL_TINYINT
SQLTypes type
Definition: sqltypes.h:898
#define NULL_SMALLINT
Definition: sqltypes.h:45
double doubleval
Definition: sqltypes.h:217

+ Here is the caller graph for this function:

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

Definition at line 794 of file sqltypes.h.

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

794  {
795  if (type == kFLOAT) {
796  return *(float*)val == NULL_FLOAT;
797  }
798  if (type == kDOUBLE) {
799  return *(double*)val == NULL_DOUBLE;
800  }
801  // val can be either compressed or uncompressed
802  switch (size) {
803  case 1:
804  return *val == NULL_TINYINT;
805  case 2:
806  return *(int16_t*)val == NULL_SMALLINT;
807  case 4:
808  return *(int32_t*)val == NULL_INT;
809  case 8:
810  return *(int64_t*)val == NULL_BIGINT;
811  case kNULLT:
812  return true;
813  default:
814  // @TODO(wei) handle null strings
815  break;
816  }
817  return false;
818  }
#define NULL_DOUBLE
#define NULL_FLOAT
#define NULL_BIGINT
#define NULL_INT
#define NULL_TINYINT
SQLTypes type
Definition: sqltypes.h:898
#define NULL_SMALLINT
HOST DEVICE bool SQLTypeInfo::is_null_fixlen_array ( const int8_t *  val,
int  array_size 
) const
inline

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

819  {
820  // Check if fixed length array has a NULL_ARRAY sentinel as the first element
821  if (type == kARRAY && val && array_size > 0 && array_size == size) {
822  // Need to create element type to get the size, but can't call get_elem_type()
823  // since this is a HOST DEVICE function. Going through copy constructor instead.
824  auto elem_ti{*this};
825  elem_ti.set_type(subtype);
826  elem_ti.set_subtype(kNULLT);
827  auto elem_size = elem_ti.get_storage_size();
828  if (elem_size < 1) {
829  return false;
830  }
831  if (subtype == kFLOAT) {
832  return *(float*)val == NULL_ARRAY_FLOAT;
833  }
834  if (subtype == kDOUBLE) {
835  return *(double*)val == NULL_ARRAY_DOUBLE;
836  }
837  switch (elem_size) {
838  case 1:
839  return *val == NULL_ARRAY_TINYINT;
840  case 2:
841  return *(int16_t*)val == NULL_ARRAY_SMALLINT;
842  case 4:
843  return *(int32_t*)val == NULL_ARRAY_INT;
844  case 8:
845  return *(int64_t*)val == NULL_ARRAY_BIGINT;
846  default:
847  return false;
848  }
849  }
850  return false;
851  }
#define NULL_ARRAY_INT
#define NULL_ARRAY_SMALLINT
#define NULL_ARRAY_TINYINT
SQLTypes subtype
Definition: sqltypes.h:899
#define NULL_ARRAY_FLOAT
#define NULL_ARRAY_DOUBLE
SQLTypes type
Definition: sqltypes.h:898
#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 852 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().

853  {
854  if (type == kARRAY && subtype == kTINYINT && val && array_size > 0 &&
855  array_size == size) {
856  if (array_size == 2 * sizeof(double)) {
857  return *(double*)val == NULL_ARRAY_DOUBLE;
858  }
859  if (array_size == 2 * sizeof(int32_t)) {
860  return *(uint32_t*)val == NULL_ARRAY_COMPRESSED_32;
861  }
862  }
863  return false;
864  }
#define NULL_ARRAY_COMPRESSED_32
SQLTypes subtype
Definition: sqltypes.h:899
#define NULL_ARRAY_DOUBLE
SQLTypes type
Definition: sqltypes.h:898

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

652  {
653  const auto& new_type = new_type_info.get_type();
654  switch (type) {
655  case kBOOLEAN:
656  return new_type == kBOOLEAN;
657  case kTINYINT:
658  case kSMALLINT:
659  case kINT:
660  if (!new_type_info.is_number()) {
661  return false;
662  }
663  if (new_type_info.is_fp()) {
664  // We can lose precision here, but preserving existing behavior
665  return true;
666  }
667  return new_type_info.get_logical_size() >= get_logical_size();
668  case kBIGINT:
669  return new_type == kBIGINT || new_type == kDOUBLE || new_type == kFLOAT;
670  case kFLOAT:
671  case kDOUBLE:
672  if (!new_type_info.is_fp()) {
673  return false;
674  }
675  return (new_type_info.get_logical_size() >= get_logical_size());
676  case kDECIMAL:
677  case kNUMERIC:
678  switch (new_type) {
679  case kDECIMAL:
680  case kNUMERIC:
681  return new_type_info.get_dimension() >= get_dimension();
682  case kDOUBLE:
683  return true;
684  case kFLOAT:
685  return get_dimension() <= 7;
686  default:
687  return false;
688  }
689  case kTIMESTAMP:
690  if (new_type != kTIMESTAMP) {
691  return false;
692  }
693  return new_type_info.get_dimension() >= get_dimension();
694  case kDATE:
695  return new_type == kDATE;
696  case kTIME:
697  return new_type == kTIME;
698  default:
699  UNREACHABLE();
700  return false;
701  }
702  }
Definition: sqltypes.h:49
bool is_fp() const
Definition: sqltypes.h:514
#define UNREACHABLE()
Definition: Logger.h:267
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:329
bool is_number() const
Definition: sqltypes.h:515
int get_logical_size() const
Definition: sqltypes.h:349
Definition: sqltypes.h:53
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:331
SQLTypes type
Definition: sqltypes.h:898
Definition: sqltypes.h:45

+ 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 510 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::codegenCmp(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codegenHoistedConstantsPlaceholders(), Parser::common_string_type(), Analyzer::BinOper::common_string_type(), Encoder::Create(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::create_parquet_none_type_encoder(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::create_parquet_string_encoder(), CodeGenerator::createInValuesBitmap(), Analyzer::Constant::deep_copy(), Catalog_Namespace::Catalog::delDictionary(), 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(), foreign_storage::TextFileBufferParser::isNullDatum(), Fragmenter_Namespace::isStringVectorData(), ResultSet::makeVarlenTargetValue(), Executor::needLinearizeAllFragments(), Parser::CaseExpr::normalize(), HashJoin::normalizeColumnPair(), null_val_bit_pattern(), 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(), StorageIOFacility::yieldUpdateCallback(), and Analyzer::Constant::~Constant().

510 { return IS_STRING(type); }
#define IS_STRING(T)
Definition: sqltypes.h:250
SQLTypes type
Definition: sqltypes.h:898
bool SQLTypeInfo::is_string_array ( ) const
inline

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

511 { return (type == kARRAY) && IS_STRING(subtype); }
SQLTypes subtype
Definition: sqltypes.h:899
#define IS_STRING(T)
Definition: sqltypes.h:250
SQLTypes type
Definition: sqltypes.h:898

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_subtype_dict_encoded_string ( ) const
inline

Definition at line 556 of file sqltypes.h.

References compression, IS_STRING, kENCODING_DICT, and subtype.

556  {
558  }
SQLTypes subtype
Definition: sqltypes.h:899
EncodingType compression
Definition: sqltypes.h:904
#define IS_STRING(T)
Definition: sqltypes.h:250
bool SQLTypeInfo::is_time ( ) const
inline

Definition at line 516 of file sqltypes.h.

References is_datetime(), and type.

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

516 { return is_datetime(type); }
SQLTypes type
Definition: sqltypes.h:898
constexpr auto is_datetime(SQLTypes type)
Definition: sqltypes.h:263

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 519 of file sqltypes.h.

References kARRAY, size, and type.

Referenced by Fragmenter_Namespace::get_var_len_null_array_indexes().

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

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_varlen_indeed ( ) const
inline

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

542  {
543  // SQLTypeInfo.is_varlen() is broken with fixedlen array now
544  // and seems left broken for some concern, so fix it locally
545  return is_varlen() && !is_fixlen_array();
546  }
bool is_varlen() const
Definition: sqltypes.h:536
bool is_fixlen_array() const
Definition: sqltypes.h:520

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

References comp_param, compression, 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.

567  {
568  return type != rhs.get_type() || subtype != rhs.get_subtype() ||
569  dimension != rhs.get_dimension() || scale != rhs.get_scale() ||
570  compression != rhs.get_compression() ||
573  notnull != rhs.get_notnull();
574  }
HOST DEVICE SQLTypes get_subtype() const
Definition: sqltypes.h:330
HOST DEVICE int get_scale() const
Definition: sqltypes.h:334
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:329
SQLTypes subtype
Definition: sqltypes.h:899
bool notnull
Definition: sqltypes.h:903
EncodingType compression
Definition: sqltypes.h:904
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:337
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:331
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:338
SQLTypes type
Definition: sqltypes.h:898
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:336
#define TRANSIENT_DICT(ID)
Definition: sqltypes.h:260
int comp_param
Definition: sqltypes.h:905
int dimension
Definition: sqltypes.h:900

+ Here is the call graph for this function:

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

Definition at line 595 of file sqltypes.h.

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

595  {
596  type = rhs.get_type();
597  subtype = rhs.get_subtype();
598  dimension = rhs.get_dimension();
599  scale = rhs.get_scale();
600  notnull = rhs.get_notnull();
602  comp_param = rhs.get_comp_param();
603  size = rhs.get_size();
604  }
HOST DEVICE SQLTypes get_subtype() const
Definition: sqltypes.h:330
HOST DEVICE int get_size() const
Definition: sqltypes.h:339
HOST DEVICE int get_scale() const
Definition: sqltypes.h:334
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:329
SQLTypes subtype
Definition: sqltypes.h:899
bool notnull
Definition: sqltypes.h:903
EncodingType compression
Definition: sqltypes.h:904
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:337
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:331
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:338
SQLTypes type
Definition: sqltypes.h:898
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:336
int comp_param
Definition: sqltypes.h:905
int dimension
Definition: sqltypes.h:900

+ Here is the call graph for this function:

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

Definition at line 575 of file sqltypes.h.

References comp_param, compression, 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.

575  {
576  return type == rhs.get_type() && subtype == rhs.get_subtype() &&
577  dimension == rhs.get_dimension() && scale == rhs.get_scale() &&
578  compression == rhs.get_compression() &&
581  notnull == rhs.get_notnull();
582  }
HOST DEVICE SQLTypes get_subtype() const
Definition: sqltypes.h:330
HOST DEVICE int get_scale() const
Definition: sqltypes.h:334
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:329
SQLTypes subtype
Definition: sqltypes.h:899
bool notnull
Definition: sqltypes.h:903
EncodingType compression
Definition: sqltypes.h:904
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:337
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:331
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:338
SQLTypes type
Definition: sqltypes.h:898
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:336
#define TRANSIENT_DICT(ID)
Definition: sqltypes.h:260
int comp_param
Definition: sqltypes.h:905
int dimension
Definition: sqltypes.h:900

+ Here is the call graph for this function:

void SQLTypeInfo::set_comp_param ( int  p)
inline

Definition at line 441 of file sqltypes.h.

References comp_param.

Referenced by Analyzer::CaseExpr::add_cast(), Parser::QuerySpec::analyze_group_by(), Catalog_Namespace::Catalog::buildColumnsMapUnlocked(), Geospatial::convert_coords(), Catalog_Namespace::Catalog::createTable(), import_export::Importer::gdalToColumnDescriptorsGeo(), import_export::Importer::gdalToColumnDescriptorsRaster(), Parser::LocalQueryConnector::getColumnDescriptors(), 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::translateStringOper(), 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().

441 { comp_param = p; }
int comp_param
Definition: sqltypes.h:905

+ Here is the caller graph for this function:

void SQLTypeInfo::set_compression ( EncodingType  c)
inline

Definition at line 440 of file sqltypes.h.

References compression.

Referenced by Analyzer::Constant::add_cast(), Parser::QuerySpec::analyze_group_by(), Catalog_Namespace::Catalog::buildColumnsMapUnlocked(), Geospatial::convert_coords(), import_export::Importer::gdalToColumnDescriptorsGeo(), import_export::Importer::gdalToColumnDescriptorsRaster(), Parser::LocalQueryConnector::getColumnDescriptors(), 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::translateStringOper(), 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().

440 { compression = c; }
EncodingType compression
Definition: sqltypes.h:904

+ Here is the caller graph for this function:

void SQLTypeInfo::set_dict_intersection ( )
inline

Definition at line 439 of file sqltypes.h.

References dict_intersection.

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

439 { dict_intersection = true; }
bool dict_intersection
Definition: sqltypes.h:907

+ Here is the caller graph for this function:

void SQLTypeInfo::set_dimension ( int  d)
inline

Definition at line 431 of file sqltypes.h.

References dimension.

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

431 { dimension = d; }
int dimension
Definition: sqltypes.h:900

+ Here is the caller graph for this function:

void SQLTypeInfo::set_fixed_size ( )
inline

Definition at line 438 of file sqltypes.h.

References get_storage_size(), and size.

Referenced by Parser::QuerySpec::analyze_group_by(), Analyzer::BinOper::common_numeric_type(), import_export::Importer::gdalToColumnDescriptorsGeo(), import_export::Importer::gdalToColumnDescriptorsRaster(), 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::translateStringOper(), RelAlgTranslator::translateUoper(), and ddl_utils::validate_and_set_array_size().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SQLTypeInfo::set_input_srid ( int  d)
inline

Definition at line 433 of file sqltypes.h.

References dimension.

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

433 { dimension = d; }
int dimension
Definition: sqltypes.h:900

+ Here is the caller graph for this function:

void SQLTypeInfo::set_output_srid ( int  s)
inline

Definition at line 435 of file sqltypes.h.

References scale.

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

435 { scale = s; }

+ Here is the caller graph for this function:

void SQLTypeInfo::set_precision ( int  d)
inline
std::string SQLTypeInfo::to_string ( ) const
inline

Definition at line 483 of file sqltypes.h.

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

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

483  {
484  std::ostringstream oss;
485  oss << "(type=" << type_name[static_cast<int>(type)]
486  << ", dimension=" << get_dimension() << ", scale=" << get_scale()
487  << ", null=" << (get_notnull() ? "not nullable" : "nullable")
488  << ", name=" << get_compression_name() << ", comp=" << get_comp_param()
489  << ", subtype=" << type_name[static_cast<int>(subtype)] << ", size=" << get_size()
490  << ", element_size=" << get_elem_type().get_size() << ")";
491  return oss.str();
492  }
HOST DEVICE int get_size() const
Definition: sqltypes.h:339
HOST DEVICE int get_scale() const
Definition: sqltypes.h:334
std::string get_compression_name() const
Definition: sqltypes.h:481
static std::string type_name[kSQLTYPE_LAST]
Definition: sqltypes.h:909
SQLTypes subtype
Definition: sqltypes.h:899
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:331
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:338
SQLTypes type
Definition: sqltypes.h:898
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:336
SQLTypeInfo get_elem_type() const
Definition: sqltypes.h:865

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

References to_string().

Referenced by shared::convert_temporal_to_iso_format().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SQLTypeInfo::transforms ( ) const
inline

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

531  {
532  return IS_GEO(type) && get_input_srid() > 0 && get_output_srid() > 0 &&
534  }
HOST DEVICE int get_input_srid() const
Definition: sqltypes.h:333
SQLTypes type
Definition: sqltypes.h:898
#define IS_GEO(T)
Definition: sqltypes.h:251
HOST DEVICE int get_output_srid() const
Definition: sqltypes.h:335

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

Referenced by get_compression_name().

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

Definition at line 907 of file sqltypes.h.

Referenced by is_dict_intersection(), and set_dict_intersection().

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

Definition at line 909 of file sqltypes.h.

Referenced by get_type_name(), and to_string().


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