OmniSciDB  17c254d2f8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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, int d, int s)
 
 SQLTypeInfo (SQLTypes t, bool n)
 
 SQLTypeInfo (SQLTypes t)
 
 SQLTypeInfo (SQLTypes t, bool n, EncodingType c)
 
 SQLTypeInfo ()
 
HOST DEVICE SQLTypes get_type () const
 
HOST DEVICE SQLTypes get_subtype () const
 
HOST DEVICE int get_dimension () const
 
int get_precision () const
 
HOST DEVICE int get_input_srid () const
 
HOST DEVICE int get_scale () const
 
HOST DEVICE int get_output_srid () const
 
HOST DEVICE bool get_notnull () const
 
HOST DEVICE EncodingType get_compression () const
 
HOST DEVICE int get_comp_param () const
 
HOST DEVICE int get_size () const
 
int get_logical_size () const
 
int get_physical_cols () const
 
int get_physical_coord_cols () const
 
bool has_bounds () const
 
bool has_render_group () const
 
HOST DEVICE void set_type (SQLTypes t)
 
HOST DEVICE void set_subtype (SQLTypes st)
 
void set_dimension (int d)
 
void set_precision (int d)
 
void set_input_srid (int d)
 
void set_scale (int s)
 
void set_output_srid (int s)
 
void set_notnull (bool n)
 
void set_size (int s)
 
void set_fixed_size ()
 
void set_compression (EncodingType c)
 
void set_comp_param (int p)
 
std::string get_type_name () const
 
std::string get_compression_name () const
 
std::string to_string () const
 
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_varlen () const
 
bool is_varlen_indeed () const
 
bool is_dict_encoded_string () const
 
bool is_packed_pixel_coord () const
 
HOST DEVICE bool operator!= (const SQLTypeInfo &rhs) const
 
HOST DEVICE bool operator== (const SQLTypeInfo &rhs) const
 
int get_array_context_logical_size () const
 
HOST DEVICE void operator= (const SQLTypeInfo &rhs)
 
bool is_castable (const SQLTypeInfo &new_type_info) const
 
HOST DEVICE bool is_null (const Datum &d) const
 
HOST DEVICE bool is_null (const int8_t *val) const
 
HOST DEVICE bool is_null_fixlen_array (const int8_t *val, int array_size) const
 
HOST DEVICE bool is_null_point_coord_array (const int8_t *val, int array_size) const
 
SQLTypeInfo get_elem_type () const
 
SQLTypeInfo get_array_type () const
 
bool is_date_in_days () const
 
bool is_date () const
 
bool is_high_precision_timestamp () const
 
bool is_timestamp () const
 

Private Member Functions

HOST DEVICE int get_storage_size () const
 

Private Attributes

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

Static Private Attributes

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

Detailed Description

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

211  : type(t)
212  , subtype(st)
213  , dimension(d)
214  , scale(s)
215  , notnull(n)
216  , compression(c)
217  , comp_param(p)
218  , size(get_storage_size()) {}
SQLTypes subtype
Definition: sqltypes.h:651
bool notnull
Definition: sqltypes.h:654
EncodingType compression
Definition: sqltypes.h:655
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:662
SQLTypes type
Definition: sqltypes.h:650
int comp_param
Definition: sqltypes.h:656
int dimension
Definition: sqltypes.h:652
SQLTypeInfo::SQLTypeInfo ( SQLTypes  t,
int  d,
int  s,
bool  n 
)
inline

Definition at line 219 of file sqltypes.h.

220  : type(t)
221  , subtype(kNULLT)
222  , dimension(d)
223  , scale(s)
224  , notnull(n)
226  , comp_param(0)
227  , size(get_storage_size()) {}
SQLTypes subtype
Definition: sqltypes.h:651
bool notnull
Definition: sqltypes.h:654
EncodingType compression
Definition: sqltypes.h:655
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:662
SQLTypes type
Definition: sqltypes.h:650
int comp_param
Definition: sqltypes.h:656
int dimension
Definition: sqltypes.h:652
SQLTypeInfo::SQLTypeInfo ( SQLTypes  t,
int  d,
int  s 
)
inline

Definition at line 228 of file sqltypes.h.

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

Definition at line 229 of file sqltypes.h.

230  : type(t)
231  , subtype(kNULLT)
232  , dimension(0)
233  , scale(0)
234  , notnull(n)
236  , comp_param(0)
237  , size(get_storage_size()) {}
SQLTypes subtype
Definition: sqltypes.h:651
bool notnull
Definition: sqltypes.h:654
EncodingType compression
Definition: sqltypes.h:655
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:662
SQLTypes type
Definition: sqltypes.h:650
int comp_param
Definition: sqltypes.h:656
int dimension
Definition: sqltypes.h:652
SQLTypeInfo::SQLTypeInfo ( SQLTypes  t)
inline

Definition at line 238 of file sqltypes.h.

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

Definition at line 239 of file sqltypes.h.

240  : type(t)
241  , subtype(kNULLT)
242  , dimension(0)
243  , scale(0)
244  , notnull(n)
245  , compression(c)
246  , comp_param(0)
247  , size(get_storage_size()) {}
SQLTypes subtype
Definition: sqltypes.h:651
bool notnull
Definition: sqltypes.h:654
EncodingType compression
Definition: sqltypes.h:655
HOST DEVICE int get_storage_size() const
Definition: sqltypes.h:662
SQLTypes type
Definition: sqltypes.h:650
int comp_param
Definition: sqltypes.h:656
int dimension
Definition: sqltypes.h:652
SQLTypeInfo::SQLTypeInfo ( )
inline

Definition at line 248 of file sqltypes.h.

Referenced by get_array_type(), and get_elem_type().

249  : type(kNULLT)
250  , subtype(kNULLT)
251  , dimension(0)
252  , scale(0)
253  , notnull(false)
255  , comp_param(0)
256  , size(0) {}
SQLTypes subtype
Definition: sqltypes.h:651
bool notnull
Definition: sqltypes.h:654
EncodingType compression
Definition: sqltypes.h:655
SQLTypes type
Definition: sqltypes.h:650
int comp_param
Definition: sqltypes.h:656
int dimension
Definition: sqltypes.h:652

+ Here is the caller graph for this function:

Member Function Documentation

int SQLTypeInfo::get_array_context_logical_size ( ) const
inline

Definition at line 460 of file sqltypes.h.

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

Referenced by ResultSet::makeVarlenTargetValue().

460  {
461  if (is_string()) {
462  auto comp_type(get_compression());
463  if (comp_type == kENCODING_DICT || comp_type == kENCODING_FIXED ||
464  comp_type == kENCODING_NONE) {
465  return sizeof(int32_t);
466  }
467  }
468  return get_logical_size();
469  }
int get_logical_size() const
Definition: sqltypes.h:269
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:266
bool is_string() const
Definition: sqltypes.h:409

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

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

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

621  {
623  }
bool notnull
Definition: sqltypes.h:654
EncodingType compression
Definition: sqltypes.h:655
SQLTypes type
Definition: sqltypes.h:650
int comp_param
Definition: sqltypes.h:656
int dimension
Definition: sqltypes.h:652

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

HOST DEVICE int SQLTypeInfo::get_comp_param ( ) const
inline

Definition at line 267 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(), CodeGenerator::codegen(), CodeGenerator::codegenCastFromString(), CodeGenerator::codegenCompression(), Analyzer::BinOper::common_string_type(), geospatial::compress_coord(), geospatial::compress_coords(), geospatial::compress_null_point(), DictionaryConverterFactory< TARGET_TYPE >::create(), Encoder::Create(), Catalog_Namespace::Catalog::createTable(), DateDaysOverflowValidator::DateDaysOverflowValidator(), decompress(), Catalog_Namespace::Catalog::delDictionary(), Parser::InsertValuesStmt::determineLeafIndex(), DictionaryValueConverter< TARGET_TYPE >::DictionaryValueConverter(), Catalog_Namespace::Catalog::doTruncateTable(), Analyzer::ColumnVar::get_comp_param(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), get_logical_type_info(), Catalog_Namespace::Catalog::getColumnDictDirectory(), ArrowResultSetConverter::initializeColumnBuilder(), inline_fixed_encoding_null_val(), anonymous_namespace{RelAlgExecutor.cpp}::insert_one_dict_str(), anonymous_namespace{ResultSetGeoSerialization.h}::is_null_point(), ResultSet::makeTargetValue(), Parser::OperExpr::normalize(), operator!=(), TextConverterFactory::operator()(), operator=(), operator==(), DBHandler::populateThriftColumnType(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), Catalog_Namespace::Catalog::removeTableFromMap(), Catalog_Namespace::Catalog::setColumnDictionary(), Catalog_Namespace::Catalog::setColumnSharedDictionary(), to_string(), Analyzer::UOper::toString(), RelAlgTranslator::translateBinaryGeoFunction(), RelAlgTranslator::translateUnaryGeoFunction(), ThriftSerializers::type_info_to_thrift(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), and File_Namespace::FileBuffer::writeMetadata().

267 { return comp_param; }
int comp_param
Definition: sqltypes.h:656

+ Here is the caller graph for this function:

HOST DEVICE EncodingType SQLTypeInfo::get_compression ( ) const
inline

Definition at line 266 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(), Parser::InValues::analyze(), Parser::FunctionRef::analyze(), Parser::QuerySpec::analyze_group_by(), CodeGenerator::castArrayPointer(), ChunkIter_get_next(), ChunkIter_get_nth(), Importer_NS::TypedImportBuffer::clear(), CodeGenerator::codegenCastFromString(), CodeGenerator::codegenCmp(), CodeGenerator::codegenCompression(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codgenAdjustFixedEncNull(), Analyzer::BinOper::common_string_type(), geospatial::compress_coord(), geospatial::compress_coords(), geospatial::compress_null_point(), Encoder::Create(), Catalog_Namespace::Catalog::createTable(), DatumEqual(), decompress(), Analyzer::Expr::decompress(), Catalog_Namespace::Catalog::delDictionary(), Catalog_Namespace::Catalog::doTruncateTable(), encoding_to_thrift(), RelAlgExecutor::executeSimpleInsert(), extract_from_datum(), ChunkMetadata::fillChunkStats(), anonymous_namespace{ColumnarResults.cpp}::fixed_encoding_nullable_val(), get_array_context_logical_size(), Analyzer::ColumnVar::get_compression(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), anonymous_namespace{TargetExprBuilder.cpp}::get_initial_agg_val(), get_logical_type_info(), Chunk_NS::Chunk::getChunkBuffer(), Parser::LocalConnector::getColumnDescriptors(), Catalog_Namespace::Catalog::getColumnDictDirectory(), Chunk_NS::Chunk::getNumElemsForBytesInsertData(), Importer_NS::Loader::getStringDict(), ResultSet::getTargetValueFromBufferRowwise(), Chunk_NS::Chunk::initEncoder(), inline_fixed_encoding_null_val(), inline_int_null_val(), CgenState::inlineIntNull(), is_date_in_days(), FixedLengthArrayNoneEncoder::is_null(), anonymous_namespace{ResultSetGeoSerialization.h}::is_null_point(), is_real_str_or_array(), is_unsigned_type(), Fragmenter_Namespace::isStringVectorData(), ResultSet::makeTargetValue(), ResultSet::makeVarlenTargetValue(), Parser::OperExpr::normalize(), null_val_bit_pattern(), numeric_type_name(), operator!=(), TextConverterFactory::operator()(), operator=(), operator==(), Parser::InsertIntoTableAsSelectStmt::populateData(), DBHandler::populateThriftColumnType(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), Catalog_Namespace::Catalog::removeTableFromMap(), anonymous_namespace{TableOptimizer.cpp}::set_metadata_from_results(), Fragmenter_Namespace::sizeOfRawColumn(), RelAlgTranslator::translateBinaryGeoFunction(), RelAlgTranslator::translateGeoLiteral(), RelAlgTranslator::translateUnaryGeoFunction(), Importer_NS::TypedImportBuffer::TypedImportBuffer(), ExpressionRange::typeSupportsRange(), FixedLengthArrayNoneEncoder::update_elem_stats(), ArrayNoneEncoder::update_elem_stats(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), anonymous_namespace{InputMetadata.cpp}::uses_int_meta(), ddl_utils::validate_and_set_array_size(), File_Namespace::FileBuffer::writeMetadata(), and Importer_NS::TypedImportBuffer::~TypedImportBuffer().

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

Definition at line 386 of file sqltypes.h.

References comp_name, and compression.

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

386 { return comp_name[(int)compression]; }
EncodingType compression
Definition: sqltypes.h:655
static std::string comp_name[kENCODING_LAST]
Definition: sqltypes.h:660

+ Here is the caller graph for this function:

HOST DEVICE int SQLTypeInfo::get_dimension ( ) const
inline

Definition at line 260 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(), Analyzer::BinOper::common_string_type(), Catalog_Namespace::Catalog::createTable(), DatumToString(), Analyzer::Expr::decompress(), Analyzer::Constant::do_cast(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), get_logical_type_info(), anonymous_namespace{ExpressionRange.cpp}::getDateTimePrecisionCastRange(), DateTimeTranslator::getDateTruncConstantValue(), DateTimeTranslator::getExtractFromTimeConstantValue(), is_high_precision_timestamp(), operator!=(), operator=(), operator==(), parse_numeric(), Parser::InsertIntoTableAsSelectStmt::populateData(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), StringToDatum(), to_string(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), and File_Namespace::FileBuffer::writeMetadata().

260 { return dimension; }
int dimension
Definition: sqltypes.h:652

+ Here is the caller graph for this function:

SQLTypeInfo SQLTypeInfo::get_elem_type ( ) const
inline

Definition at line 617 of file sqltypes.h.

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

Referenced by Importer_NS::TypedImportBuffer::add_value(), Parser::FunctionRef::analyze(), anonymous_namespace{ResultSetIteration.cpp}::build_array_target_value(), CodeGenerator::codegenArrayBuff(), CodeGenerator::codegenFunctionOperCastArgs(), ArrayConverterFactory< ELEMENT_FACTORY >::create(), DateDaysOverflowValidator::DateDaysOverflowValidator(), datum_to_string(), DecimalOverflowValidator::DecimalOverflowValidator(), Analyzer::Constant::do_cast(), RelAlgExecutor::executeSimpleInsert(), anonymous_namespace{ExtensionsIR.cpp}::get_llvm_type_from_sql_array_type(), get_type_name(), getLeafColumnRange(), is_castable(), ResultSet::makeVarlenTargetValue(), anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_arguments(), Importer_NS::NullArray(), NullAwareValidator< INNER_VALIDATOR >::NullAwareValidator(), ArraysConverterFactory::operator()(), Parser::InsertIntoTableAsSelectStmt::populateData(), ResultSetReductionJIT::reduceOneSlot(), ResultSetStorage::reduceOneSlot(), Importer_NS::StringToArray(), Importer_NS::TDatumToArrayDatum(), to_string(), Analyzer::Constant::toString(), ThriftSerializers::type_info_to_thrift(), ExpressionRange::typeSupportsRange(), ddl_utils::validate_and_set_array_size(), DBHandler::value_to_thrift(), and DBHandler::value_to_thrift_column().

617  {
618  return SQLTypeInfo(
620  }
SQLTypes subtype
Definition: sqltypes.h:651
bool notnull
Definition: sqltypes.h:654
EncodingType compression
Definition: sqltypes.h:655
int comp_param
Definition: sqltypes.h:656
int dimension
Definition: sqltypes.h:652

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

HOST DEVICE int SQLTypeInfo::get_input_srid ( ) const
inline

Definition at line 262 of file sqltypes.h.

References dimension.

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

262 { return dimension; }
int dimension
Definition: sqltypes.h:652

+ Here is the caller graph for this function:

int SQLTypeInfo::get_logical_size ( ) const
inline

Definition at line 269 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(), Parser::InsertValuesStmt::determineLeafIndex(), get_agg_initial_val(), get_array_context_logical_size(), StorageIOFacility< EXECUTOR_TRAITS, FRAGMENT_UPDATER >::getRsBufferNoPadding(), inline_int_null_val(), anonymous_namespace{TypedDataAccessors.h}::is_null(), is_unsigned_type(), anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_arguments(), numeric_type_name(), and Fragmenter_Namespace::sizeOfRawColumn().

269  {
272  return ti.get_size();
273  }
274  if (compression == kENCODING_DICT) {
275  return 4;
276  }
277  return get_size();
278  }
HOST DEVICE int get_size() const
Definition: sqltypes.h:268
SQLTypes subtype
Definition: sqltypes.h:651
bool notnull
Definition: sqltypes.h:654
EncodingType compression
Definition: sqltypes.h:655
SQLTypes type
Definition: sqltypes.h:650
int dimension
Definition: sqltypes.h:652

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

References notnull.

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

265 { return notnull; }
bool notnull
Definition: sqltypes.h:654
HOST DEVICE int SQLTypeInfo::get_output_srid ( ) const
inline

Definition at line 264 of file sqltypes.h.

References scale.

Referenced by geospatial::compress_coords(), get_type_name(), DBHandler::populateThriftColumnType(), ddl_utils::set_default_encoding(), RelAlgTranslator::translateBinaryGeoFunction(), RelAlgTranslator::translateGeoFunctionArg(), RelAlgTranslator::translateGeoLiteral(), RelAlgTranslator::translateUnaryGeoFunction(), and ddl_utils::validate_and_set_compressed_encoding().

264 { return scale; }

+ Here is the caller graph for this function:

int SQLTypeInfo::get_physical_cols ( ) const
inline

Definition at line 279 of file sqltypes.h.

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

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

279  {
280  switch (type) {
281  case kPOINT:
282  return 1; // coords
283  case kLINESTRING:
284  return 2; // coords, bounds
285  case kPOLYGON:
286  return 4; // coords, ring_sizes, bounds, render_group
287  case kMULTIPOLYGON:
288  return 5; // coords, ring_sizes, poly_rings, bounds, render_group
289  default:
290  break;
291  }
292  return 0;
293  }
SQLTypes type
Definition: sqltypes.h:650

+ Here is the caller graph for this function:

int SQLTypeInfo::get_physical_coord_cols ( ) const
inline

Definition at line 294 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(), get_slots_for_geo_target(), and RelAlgTranslator::translateGeoColumn().

294  {
295  // @TODO dmitri/simon rename this function?
296  // It needs to return the number of extra columns
297  // which need to go through the executor, as opposed
298  // to those which are only needed by CPU for poly
299  // cache building or what-not. For now, we just omit
300  // the Render Group column. If we add Bounding Box
301  // or something this may require rethinking. Perhaps
302  // these two functions need to return an array of
303  // offsets rather than just a number to loop over,
304  // so that executor and non-executor columns can
305  // be mixed.
306  // NOTE(adb): In binding to extension functions, we need to know some pretty specific
307  // type info about each of the physical coords cols for each geo type. I added checks
308  // there to ensure the physical coords col for the geo type match what we expect. If
309  // these values are ever changed, corresponding values in
310  // ExtensionFunctionsBinding.cpp::compute_narrowing_conv_scores and
311  // ExtensionFunctionsBinding.cpp::compute_widening_conv_scores will also need to be
312  // changed.
313  switch (type) {
314  case kPOINT:
315  return 1;
316  case kLINESTRING:
317  return 1; // omit bounds
318  case kPOLYGON:
319  return 2; // omit bounds, render group
320  case kMULTIPOLYGON:
321  return 3; // omit bounds, render group
322  default:
323  break;
324  }
325  return 0;
326  }
SQLTypes type
Definition: sqltypes.h:650

+ Here is the caller graph for this function:

int SQLTypeInfo::get_precision ( ) const
inline
HOST DEVICE int SQLTypeInfo::get_scale ( ) const
inline

Definition at line 263 of file sqltypes.h.

References scale.

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

263 { return scale; }

+ Here is the caller graph for this function:

HOST DEVICE int SQLTypeInfo::get_size ( ) const
inline

Definition at line 268 of file sqltypes.h.

References size.

Referenced by Importer_NS::TypedImportBuffer::add_value(), Catalog_Namespace::Catalog::addColumn(), Importer_NS::TypedImportBuffer::addDictEncodedString(), ArrayValueConverter< ELEMENT_CONVERTER >::ArrayValueConverter(), Chunk_NS::Chunk::begin_iterator(), anonymous_namespace{CastIR.cpp}::byte_array_cast(), CodeGenerator::castArrayPointer(), anonymous_namespace{QueryRewrite.cpp}::check_string_id_overflow(), Importer_NS::TypedImportBuffer::clear(), CodeGenerator::codegenAdd(), CodeGenerator::codegenCast(), CodeGenerator::codegenMul(), CodeGenerator::codegenSub(), CodeGenerator::codgenAdjustFixedEncNull(), GroupByAndAggregate::convertNullIfAny(), NumericConverterFactory< SOURCE_TYPE, TARGET_TYPE >::create(), DictionaryConverterFactory< TARGET_TYPE >::create(), Encoder::Create(), Catalog_Namespace::Catalog::createTable(), decimal_to_int_type(), Parser::InsertValuesStmt::determineLeafIndex(), RelAlgExecutor::executeSimpleInsert(), Fragmenter_Namespace::FixedLenArrayChunkConverter::FixedLenArrayChunkConverter(), get_bit_width(), anonymous_namespace{ArrowResultSetConverter.cpp}::get_dict_index_type(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), get_logical_size(), anonymous_namespace{ArrowResultSetConverter.cpp}::get_physical_type(), anonymous_namespace{TypedDataAccessors.h}::get_scalar(), getArrowImportType(), Parser::LocalConnector::getColumnDescriptors(), Chunk_NS::Chunk::getNumElemsForBytesInsertData(), StorageIOFacility< EXECUTOR_TRAITS, FRAGMENT_UPDATER >::getRsBufferNoPadding(), Importer_NS::TypedImportBuffer::getStringDictBuffer(), inline_fixed_encoding_null_val(), is_unsigned_type(), ColumnFetcher::makeJoinColumn(), Importer_NS::NullArray(), TextConverterFactory::operator()(), operator=(), Parser::InsertIntoTableAsSelectStmt::populateData(), DBHandler::populateThriftColumnType(), anonymous_namespace{TypedDataAccessors.h}::put_null(), anonymous_namespace{TypedDataAccessors.h}::put_null_array(), Fragmenter_Namespace::sizeOfRawColumn(), Importer_NS::StringToArray(), Importer_NS::TDatumToArrayDatum(), to_string(), ThriftSerializers::type_info_to_thrift(), Importer_NS::TypedImportBuffer::TypedImportBuffer(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumns(), ddl_utils::validate_and_set_array_size(), File_Namespace::FileBuffer::writeMetadata(), and Importer_NS::TypedImportBuffer::~TypedImportBuffer().

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

Definition at line 662 of file sqltypes.h.

References assert(), comp_param, compression, dimension, kARRAY, kBIGINT, kBOOLEAN, kCHAR, kDATE, kDECIMAL, kDOUBLE, kENCODING_DATE_IN_DAYS, kENCODING_DICT, kENCODING_DIFF, kENCODING_FIXED, kENCODING_NONE, kENCODING_PACKED_PIXEL_COORD, 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().

662  {
663  switch (type) {
664  case kBOOLEAN:
665  return sizeof(int8_t);
666  case kTINYINT:
667  return sizeof(int8_t);
668  case kSMALLINT:
669  switch (compression) {
670  case kENCODING_NONE:
671  return sizeof(int16_t);
672  case kENCODING_FIXED:
673  case kENCODING_SPARSE:
674  return comp_param / 8;
675  case kENCODING_RL:
676  case kENCODING_DIFF:
677  break;
678  default:
679  assert(false);
680  }
681  break;
682  case kINT:
683  switch (compression) {
684  case kENCODING_NONE:
686  return sizeof(int32_t);
687  case kENCODING_FIXED:
688  case kENCODING_SPARSE:
689  return comp_param / 8;
690  case kENCODING_RL:
691  case kENCODING_DIFF:
692  break;
693  default:
694  assert(false);
695  }
696  break;
697  case kBIGINT:
698  case kNUMERIC:
699  case kDECIMAL:
700  switch (compression) {
701  case kENCODING_NONE:
702  return sizeof(int64_t);
703  case kENCODING_FIXED:
704  case kENCODING_SPARSE:
705  return comp_param / 8;
706  case kENCODING_RL:
707  case kENCODING_DIFF:
708  break;
709  default:
710  assert(false);
711  }
712  break;
713  case kFLOAT:
714  switch (compression) {
715  case kENCODING_NONE:
716  return sizeof(float);
717  case kENCODING_FIXED:
718  case kENCODING_RL:
719  case kENCODING_DIFF:
720  case kENCODING_SPARSE:
721  assert(false);
722  break;
723  default:
724  assert(false);
725  }
726  break;
727  case kDOUBLE:
728  switch (compression) {
729  case kENCODING_NONE:
730  return sizeof(double);
731  case kENCODING_FIXED:
732  case kENCODING_RL:
733  case kENCODING_DIFF:
734  case kENCODING_SPARSE:
735  assert(false);
736  break;
737  default:
738  assert(false);
739  }
740  break;
741  case kTIMESTAMP:
742  case kTIME:
743  case kINTERVAL_DAY_TIME:
745  case kDATE:
746  switch (compression) {
747  case kENCODING_NONE:
748  return sizeof(int64_t);
749  case kENCODING_FIXED:
750  if (type == kTIMESTAMP && dimension > 0) {
751  assert(false); // disable compression for timestamp precisions
752  }
753  return comp_param / 8;
754  case kENCODING_RL:
755  case kENCODING_DIFF:
756  case kENCODING_SPARSE:
757  assert(false);
758  break;
760  switch (comp_param) {
761  case 0:
762  return 4; // Default date encoded in days is 32 bits
763  case 16:
764  case 32:
765  return comp_param / 8;
766  default:
767  assert(false);
768  break;
769  }
770  default:
771  assert(false);
772  }
773  break;
774  case kTEXT:
775  case kVARCHAR:
776  case kCHAR:
777  if (compression == kENCODING_DICT) {
778  return sizeof(int32_t); // @TODO(wei) must check DictDescriptor
779  }
780  break;
781  case kARRAY:
782  // TODO: return size for fixlen arrays?
783  break;
784  case kPOINT:
785  case kLINESTRING:
786  case kPOLYGON:
787  case kMULTIPOLYGON:
788  break;
789  default:
790  break;
791  }
792  return -1;
793  }
Definition: sqltypes.h:50
EncodingType compression
Definition: sqltypes.h:655
Definition: sqltypes.h:53
Definition: sqltypes.h:54
int64_t const int32_t sz assert(dest)
Definition: sqltypes.h:42
SQLTypes type
Definition: sqltypes.h:650
Definition: sqltypes.h:46
int comp_param
Definition: sqltypes.h:656
int dimension
Definition: sqltypes.h:652

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

HOST DEVICE SQLTypes SQLTypeInfo::get_subtype ( ) const
inline

Definition at line 259 of file sqltypes.h.

References subtype.

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

259 { return subtype; }
SQLTypes subtype
Definition: sqltypes.h:651

+ Here is the caller graph for this function:

HOST DEVICE SQLTypes SQLTypeInfo::get_type ( ) const
inline

Definition at line 258 of file sqltypes.h.

References type.

Referenced by Importer_NS::TypedImportBuffer::add_arrow_values(), Importer_NS::TypedImportBuffer::add_value(), Importer_NS::TypedImportBuffer::add_values(), Catalog_Namespace::Catalog::addColumn(), Parser::ArrayLiteral::analyze(), Parser::FunctionRef::analyze(), Parser::InsertValuesStmt::analyze(), Analyzer::BinOper::analyze_type_info(), appendDatum(), Analyzer::Constant::cast_number(), Analyzer::Constant::cast_string(), Analyzer::Constant::cast_to_string(), CodeGenerator::castArrayPointer(), Importer_NS::TypedImportBuffer::clear(), TargetExprCodegen::codegen(), CodeGenerator::codegenCast(), CodeGenerator::codegenCastFromFp(), CodeGenerator::codegenCastToFp(), CodeGenerator::codegenCmp(), CodeGenerator::codegenDiv(), CodeGenerator::codegenFunctionOper(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codegenIsNullNumber(), Analyzer::BinOper::common_numeric_type(), Analyzer::BinOper::common_string_type(), geospatial::compress_coords(), Importer_NS::TypedImportBuffer::convert_arrow_val_to_import_buffer(), TargetValueConverterFactory::create(), Encoder::Create(), Catalog_Namespace::Catalog::createTable(), Analyzer::Datum_equal(), DatumEqual(), DatumToString(), decompress(), Analyzer::Expr::decompress(), Analyzer::Constant::deep_copy(), Analyzer::Constant::do_cast(), RelAlgExecutor::executeSimpleInsert(), Parser::anonymous_namespace{ParserNode.cpp}::expr_is_null(), extract_from_datum(), anonymous_namespace{ExpressionRange.cpp}::extract_max_stat_double(), anonymous_namespace{ExpressionRange.cpp}::extract_min_stat_double(), anonymous_namespace{ResultSetIteration.cpp}::GeoLazyFetchHandler::fetch(), anonymous_namespace{ResultSetIteration.cpp}::GeoQueryOutputFetchHandler::fetch(), ChunkMetadata::fillChunkStats(), anonymous_namespace{WindowContext.cpp}::fp_comparator(), anonymous_namespace{ExpressionRange.cpp}::fpRangeFromDecimal(), get_bit_width(), anonymous_namespace{JoinHashTable.cpp}::get_bucketized_hash_entry_info(), anonymous_namespace{ArrowResultSetConverter.cpp}::get_dict_index_type(), ExtensionFunctionsWhitelist::get_ext_funcs(), get_logical_type_info(), anonymous_namespace{ArrowResultSetConverter.cpp}::get_physical_type(), anonymous_namespace{TypedDataAccessors.h}::get_scalar(), anonymous_namespace{WindowFunctionIR.cpp}::get_window_agg_name(), getArrowImportType(), Importer_NS::TypedImportBuffer::getAsBytes(), Chunk_NS::Chunk::getChunkBuffer(), EmbeddedDatabase::CursorImpl::getColType(), Importer_NS::TypedImportBuffer::getElementSize(), getExpressionRange(), Geo_namespace::GeoTypesFactory::getGeoColumns(), JoinHashTable::getHashJoinArgs(), Geo_namespace::GeoTypesFactory::getNullGeoColumns(), Chunk_NS::Chunk::getNumElemsForBytesInsertData(), StorageIOFacility< EXECUTOR_TRAITS, FRAGMENT_UPDATER >::getRsBufferNoPadding(), Importer_NS::Loader::getStringDict(), Analyzer::ColumnVar::group_predicates(), Importer_NS::Importer::importDelimited(), Importer_NS::Importer::importGDAL(), Chunk_NS::Chunk::initEncoder(), inline_fp_null_val(), inline_int_null_val(), anonymous_namespace{Execute.cpp}::inline_null_val(), CgenState::inlineFpNull(), CgenState::inlineIntNull(), is_castable(), anonymous_namespace{ResultSetGeoSerialization.h}::is_null_point(), anonymous_namespace{ScalarCodeGenerator.cpp}::llvm_type_from_sql(), DBHandler::load_table(), make_fp_constant(), ResultSet::makeGeoTargetValue(), anonymous_namespace{RelAlgTranslator.cpp}::makeNumericConstant(), ResultSet::makeTargetValue(), ResultSet::makeVarlenTargetValue(), anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_arguments(), anonymous_namespace{WindowExpressionRewrite.cpp}::matches_gt_bigint_zero(), need_patch_unnest_double(), Parser::CaseExpr::normalize(), null_val_bit_pattern(), Importer_NS::NullArrayDatum(), Importer_NS::NullDatum(), numeric_type_name(), operator!=(), operator=(), operator==(), pair_to_double(), Importer_NS::TypedImportBuffer::pop_value(), populate_TColumn(), Parser::InsertIntoTableAsSelectStmt::populateData(), DBHandler::populateThriftColumnType(), anonymous_namespace{TypedDataAccessors.h}::put_null(), anonymous_namespace{TypedDataAccessors.h}::put_null_array(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), ArrowCsvForeignStorage::read(), ddl_utils::set_default_encoding(), Importer_NS::Importer::set_geo_physical_import_buffer(), Importer_NS::Importer::set_geo_physical_import_buffer_columnar(), anonymous_namespace{TableOptimizer.cpp}::set_metadata_from_results(), Analyzer::Constant::set_null_value(), Fragmenter_Namespace::sizeOfRawColumn(), StringToDatum(), takes_float_argument(), Importer_NS::TDatumToDatum(), Analyzer::Constant::toString(), RelAlgTranslator::translateBinaryGeoFunction(), RelAlgTranslator::translateGeoColumn(), RelAlgTranslator::translateGeoFunctionArg(), RelAlgTranslator::translateGeoLiteral(), RelAlgTranslator::translateGeoOverlapsOper(), RelAlgTranslator::translateUnaryGeoFunction(), type_to_thrift(), Importer_NS::TypedImportBuffer::TypedImportBuffer(), ddl_utils::validate_and_set_date_encoding(), ddl_utils::validate_and_set_fixed_encoding(), DBHandler::value_to_thrift(), DBHandler::value_to_thrift_column(), anonymous_namespace{WindowExpressionRewrite.cpp}::window_sum_and_count_match(), File_Namespace::FileBuffer::writeMetadata(), and Importer_NS::TypedImportBuffer::~TypedImportBuffer().

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

Definition at line 361 of file sqltypes.h.

References CHECK_LT, dimension, get_elem_type(), get_output_srid(), IS_GEO, kARRAY, kDECIMAL, kNUMERIC, kSQLTYPE_LAST, kTIMESTAMP, scale, size, subtype, to_string(), type, and type_name.

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

361  {
362  if (IS_GEO(type)) {
363  std::string srid_string = "";
364  if (get_output_srid() > 0) {
365  srid_string = ", " + std::to_string(get_output_srid());
366  }
367  CHECK_LT(static_cast<int>(subtype), kSQLTYPE_LAST);
368  return type_name[static_cast<int>(subtype)] + "(" +
369  type_name[static_cast<int>(type)] + srid_string + ")";
370  }
371  std::string ps = "";
372  if (type == kDECIMAL || type == kNUMERIC || subtype == kDECIMAL ||
373  subtype == kNUMERIC) {
374  ps = "(" + std::to_string(dimension) + "," + std::to_string(scale) + ")";
375  } else if (type == kTIMESTAMP) {
376  ps = "(" + std::to_string(dimension) + ")";
377  }
378  if (type == kARRAY) {
379  auto elem_ti = get_elem_type();
380  auto num_elems = (size > 0) ? std::to_string(size / elem_ti.get_size()) : "";
381  CHECK_LT(static_cast<int>(subtype), kSQLTYPE_LAST);
382  return type_name[static_cast<int>(subtype)] + ps + "[" + num_elems + "]";
383  }
384  return type_name[static_cast<int>(type)] + ps;
385  }
std::string to_string(char const *&&v)
static std::string type_name[kSQLTYPE_LAST]
Definition: sqltypes.h:659
SQLTypes subtype
Definition: sqltypes.h:651
#define CHECK_LT(x, y)
Definition: Logger.h:207
SQLTypes type
Definition: sqltypes.h:650
size_t num_elems
SQLTypeInfo get_elem_type() const
Definition: sqltypes.h:617
#define IS_GEO(T)
Definition: sqltypes.h:173
int dimension
Definition: sqltypes.h:652
HOST DEVICE int get_output_srid() const
Definition: sqltypes.h:264

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

References kLINESTRING, kMULTIPOLYGON, kPOLYGON, and type.

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

327  {
328  switch (type) {
329  case kLINESTRING:
330  case kPOLYGON:
331  case kMULTIPOLYGON:
332  return true;
333  default:
334  break;
335  }
336  return false;
337  }
SQLTypes type
Definition: sqltypes.h:650

+ Here is the caller graph for this function:

bool SQLTypeInfo::has_render_group ( ) const
inline

Definition at line 338 of file sqltypes.h.

References kMULTIPOLYGON, kPOLYGON, and type.

Referenced by RelAlgTranslator::translateGeoColumn().

338  {
339  switch (type) {
340  case kPOLYGON:
341  case kMULTIPOLYGON:
342  return true;
343  default:
344  break;
345  }
346  return false;
347  }
SQLTypes type
Definition: sqltypes.h:650

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_array ( ) const
inline

Definition at line 417 of file sqltypes.h.

References kARRAY, and type.

Referenced by CodeGenerator::beginArgsNullcheck(), anonymous_namespace{ResultSetIteration.cpp}::build_array_target_value(), anonymous_namespace{CastIR.cpp}::byte_array_cast(), CodeGenerator::codegenFunctionOperCastArgs(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codegenHoistedConstantsPlaceholders(), Catalog_Namespace::Catalog::createTable(), DateDaysOverflowValidator::DateDaysOverflowValidator(), datum_to_string(), DecimalOverflowValidator::DecimalOverflowValidator(), Analyzer::Constant::do_cast(), CodeGenerator::endArgsNullcheck(), anonymous_namespace{TypedDataAccessors.h}::get_element_size(), anonymous_namespace{ExtensionsIR.cpp}::get_llvm_type_from_sql_array_type(), Parser::LocalConnector::getColumnDescriptors(), getLeafColumnRange(), ResultSet::getTargetValueFromBufferRowwise(), CodeGenerator::hashJoinLhs(), is_real_str_or_array(), Fragmenter_Namespace::isDatumVectorData(), ResultSet::makeVarlenTargetValue(), anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_arguments(), null_val_bit_pattern(), NullAwareValidator< INNER_VALIDATOR >::NullAwareValidator(), Analyzer::Constant::operator==(), Parser::InsertIntoTableAsSelectStmt::populateData(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), Catalog_Namespace::Catalog::setColumnDictionary(), anonymous_namespace{LogicalIR.cpp}::should_defer_eval(), Analyzer::Constant::toString(), ThriftSerializers::type_info_to_thrift(), ExpressionRange::typeSupportsRange(), DBHandler::value_to_thrift(), and DBHandler::value_to_thrift_column().

417 { return type == kARRAY; }
SQLTypes type
Definition: sqltypes.h:650

+ Here is the caller graph for this function:

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

Definition at line 482 of file sqltypes.h.

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

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

482  {
483  // can always cast between the same type but different precision/scale/encodings
484  if (type == new_type_info.get_type()) {
485  return true;
486  // can always cast from or to string
487  } else if (is_string() || new_type_info.is_string()) {
488  return true;
489  // can cast between numbers
490  } else if (is_number() && new_type_info.is_number()) {
491  return true;
492  // can cast from timestamp or date to number (epoch)
493  } else if ((type == kTIMESTAMP || type == kDATE) && new_type_info.is_number()) {
494  return true;
495  // can cast from date to timestamp
496  } else if (type == kDATE && new_type_info.get_type() == kTIMESTAMP) {
497  return true;
498  } else if (type == kTIMESTAMP && new_type_info.get_type() == kDATE) {
499  return true;
500  } else if (type == kBOOLEAN && new_type_info.is_number()) {
501  return true;
502  } else if (type == kARRAY && new_type_info.get_type() == kARRAY) {
503  return get_elem_type().is_castable(new_type_info.get_elem_type());
504  } else {
505  return false;
506  }
507  }
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:258
bool is_number() const
Definition: sqltypes.h:414
bool is_castable(const SQLTypeInfo &new_type_info) const
Definition: sqltypes.h:482
Definition: sqltypes.h:54
SQLTypes type
Definition: sqltypes.h:650
bool is_string() const
Definition: sqltypes.h:409
SQLTypeInfo get_elem_type() const
Definition: sqltypes.h:617

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_date ( ) const
inline

Definition at line 635 of file sqltypes.h.

References kDATE, and type.

Referenced by Analyzer::Constant::add_cast(), and anonymous_namespace{ExpressionRange.cpp}::getDateTimePrecisionCastRange().

635 { return type == kDATE; }
Definition: sqltypes.h:54
SQLTypes type
Definition: sqltypes.h:650

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_date_in_days ( ) const
inline

Definition at line 625 of file sqltypes.h.

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

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

625  {
626  if (type == kDATE) {
627  const auto comp_type = get_compression();
628  if (comp_type == kENCODING_DATE_IN_DAYS) {
629  return true;
630  }
631  }
632  return false;
633  }
Definition: sqltypes.h:54
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:266
SQLTypes type
Definition: sqltypes.h:650

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

References kDECIMAL, kNUMERIC, and type.

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

412 { return type == kDECIMAL || type == kNUMERIC; }
SQLTypes type
Definition: sqltypes.h:650

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_dict_encoded_string ( ) const
inline

Definition at line 435 of file sqltypes.h.

References compression, is_string(), and kENCODING_DICT.

Referenced by ArrowResultSetConverter::append(), anonymous_namespace{ArrowResultSetConverter.cpp}::create_or_append_validity(), anonymous_namespace{ArrowResultSetConverter.cpp}::get_arrow_type(), anonymous_namespace{ArrowResultSetConverter.cpp}::get_dict_index_type(), StorageIOFacility< EXECUTOR_TRAITS, FRAGMENT_UPDATER >::getRsBufferNoPadding(), ArrowResultSetConverter::initializeColumnBuilder(), ArrowCsvForeignStorage::read(), and Fragmenter_Namespace::InsertOrderFragmenter::updateChunkStats().

435  {
436  return is_string() && compression == kENCODING_DICT;
437  }
EncodingType compression
Definition: sqltypes.h:655
bool is_string() const
Definition: sqltypes.h:409

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_fixlen_array ( ) const
inline

Definition at line 419 of file sqltypes.h.

References kARRAY, size, and type.

Referenced by Chunk_NS::Chunk::createChunkBuffer(), Chunk_NS::Chunk::getChunkBuffer(), Chunk_NS::Chunk::initEncoder(), is_varlen_indeed(), and Chunk_NS::Chunk::isChunkOnDevice().

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

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_high_precision_timestamp ( ) const
inline

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

637  {
638  if (type == kTIMESTAMP) {
639  const auto dimension = get_dimension();
640  if (dimension > 0) {
641  return true;
642  }
643  }
644  return false;
645  }
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:260
SQLTypes type
Definition: sqltypes.h:650
int dimension
Definition: sqltypes.h:652

+ 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 509 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(), and decompress().

509  {
510  // assuming Datum is always uncompressed
511  switch (type) {
512  case kBOOLEAN:
513  return (int8_t)d.boolval == NULL_BOOLEAN;
514  case kTINYINT:
515  return d.tinyintval == NULL_TINYINT;
516  case kSMALLINT:
517  return d.smallintval == NULL_SMALLINT;
518  case kINT:
519  return d.intval == NULL_INT;
520  case kBIGINT:
521  case kNUMERIC:
522  case kDECIMAL:
523  return d.bigintval == NULL_BIGINT;
524  case kFLOAT:
525  return d.floatval == NULL_FLOAT;
526  case kDOUBLE:
527  return d.doubleval == NULL_DOUBLE;
528  case kTIME:
529  case kTIMESTAMP:
530  case kDATE:
531  return d.bigintval == NULL_BIGINT;
532  case kTEXT:
533  case kVARCHAR:
534  case kCHAR:
535  // @TODO handle null strings
536  break;
537  case kNULLT:
538  return true;
539  case kARRAY:
540  return d.arrayval == NULL || d.arrayval->is_null;
541  default:
542  break;
543  }
544  return false;
545  }
int8_t tinyintval
Definition: sqltypes.h:133
#define NULL_DOUBLE
Definition: sqltypes.h:185
Definition: sqltypes.h:50
bool is_null
Definition: sqltypes.h:74
#define NULL_BIGINT
Definition: sqltypes.h:183
bool boolval
Definition: sqltypes.h:132
VarlenDatum * arrayval
Definition: sqltypes.h:139
int32_t intval
Definition: sqltypes.h:135
float floatval
Definition: sqltypes.h:137
#define NULL_TINYINT
Definition: sqltypes.h:180
int64_t bigintval
Definition: sqltypes.h:136
#define NULL_FLOAT
Definition: sqltypes.h:184
int16_t smallintval
Definition: sqltypes.h:134
#define NULL_INT
Definition: sqltypes.h:182
Definition: sqltypes.h:53
Definition: sqltypes.h:54
Definition: sqltypes.h:42
#define NULL_SMALLINT
Definition: sqltypes.h:181
SQLTypes type
Definition: sqltypes.h:650
Definition: sqltypes.h:46
#define NULL_BOOLEAN
Definition: sqltypes.h:179
double doubleval
Definition: sqltypes.h:138

+ Here is the caller graph for this function:

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

Definition at line 546 of file sqltypes.h.

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

546  {
547  if (type == kFLOAT) {
548  return *(float*)val == NULL_FLOAT;
549  }
550  if (type == kDOUBLE) {
551  return *(double*)val == NULL_DOUBLE;
552  }
553  // val can be either compressed or uncompressed
554  switch (size) {
555  case 1:
556  return *val == NULL_TINYINT;
557  case 2:
558  return *(int16_t*)val == NULL_SMALLINT;
559  case 4:
560  return *(int32_t*)val == NULL_INT;
561  case 8:
562  return *(int64_t*)val == NULL_BIGINT;
563  case kNULLT:
564  return true;
565  default:
566  // @TODO(wei) handle null strings
567  break;
568  }
569  return false;
570  }
#define NULL_DOUBLE
Definition: sqltypes.h:185
#define NULL_BIGINT
Definition: sqltypes.h:183
#define NULL_TINYINT
Definition: sqltypes.h:180
#define NULL_FLOAT
Definition: sqltypes.h:184
#define NULL_INT
Definition: sqltypes.h:182
#define NULL_SMALLINT
Definition: sqltypes.h:181
SQLTypes type
Definition: sqltypes.h:650
HOST DEVICE bool SQLTypeInfo::is_null_fixlen_array ( const int8_t *  val,
int  array_size 
) const
inline

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

571  {
572  // Check if fixed length array has a NULL_ARRAY sentinel as the first element
573  if (type == kARRAY && val && array_size > 0 && array_size == size) {
574  // Need to create element type to get the size, but can't call get_elem_type()
575  // since this is a HOST DEVICE function. Going through copy constructor instead.
576  auto elem_ti{*this};
577  elem_ti.set_type(subtype);
578  elem_ti.set_subtype(kNULLT);
579  auto elem_size = elem_ti.get_storage_size();
580  if (elem_size < 1) {
581  return false;
582  }
583  if (subtype == kFLOAT) {
584  return *(float*)val == NULL_ARRAY_FLOAT;
585  }
586  if (subtype == kDOUBLE) {
587  return *(double*)val == NULL_ARRAY_DOUBLE;
588  }
589  switch (elem_size) {
590  case 1:
591  return *val == NULL_ARRAY_TINYINT;
592  case 2:
593  return *(int16_t*)val == NULL_ARRAY_SMALLINT;
594  case 4:
595  return *(int32_t*)val == NULL_ARRAY_INT;
596  case 8:
597  return *(int64_t*)val == NULL_ARRAY_BIGINT;
598  default:
599  return false;
600  }
601  }
602  return false;
603  }
#define NULL_ARRAY_DOUBLE
Definition: sqltypes.h:193
#define NULL_ARRAY_SMALLINT
Definition: sqltypes.h:189
#define NULL_ARRAY_TINYINT
Definition: sqltypes.h:188
SQLTypes subtype
Definition: sqltypes.h:651
#define NULL_ARRAY_INT
Definition: sqltypes.h:190
#define NULL_ARRAY_BIGINT
Definition: sqltypes.h:191
SQLTypes type
Definition: sqltypes.h:650
#define NULL_ARRAY_FLOAT
Definition: sqltypes.h:192

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

605  {
606  if (type == kARRAY && subtype == kTINYINT && val && array_size > 0 &&
607  array_size == size) {
608  if (array_size == 2 * sizeof(double)) {
609  return *(double*)val == NULL_ARRAY_DOUBLE;
610  }
611  if (array_size == 2 * sizeof(int32_t)) {
612  return *(uint32_t*)val == NULL_ARRAY_COMPRESSED_32;
613  }
614  }
615  return false;
616  }
#define NULL_ARRAY_COMPRESSED_32
Definition: sqltypes.h:195
#define NULL_ARRAY_DOUBLE
Definition: sqltypes.h:193
SQLTypes subtype
Definition: sqltypes.h:651
SQLTypes type
Definition: sqltypes.h:650

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_packed_pixel_coord ( ) const
inline

Definition at line 439 of file sqltypes.h.

References compression, kENCODING_PACKED_PIXEL_COORD, kINT, and type.

439  {
441  }
EncodingType compression
Definition: sqltypes.h:655
SQLTypes type
Definition: sqltypes.h:650
Definition: sqltypes.h:46
bool SQLTypeInfo::is_string ( ) const
inline

Definition at line 409 of file sqltypes.h.

References IS_STRING, and type.

Referenced by Analyzer::Expr::add_cast(), Analyzer::UOper::add_cast(), Analyzer::CaseExpr::add_cast(), Parser::InValues::analyze(), Parser::FunctionRef::analyze(), Parser::QuerySpec::analyze_group_by(), Analyzer::BinOper::analyze_type_info(), CodeGenerator::castArrayPointer(), CodeGenerator::codegenCast(), CodeGenerator::codegenCastFromString(), CodeGenerator::codegenCmp(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codegenHoistedConstantsPlaceholders(), Analyzer::BinOper::common_string_type(), Encoder::Create(), CodeGenerator::createInValuesBitmap(), Analyzer::Constant::deep_copy(), Catalog_Namespace::Catalog::delDictionary(), Parser::InsertValuesStmt::determineLeafIndex(), Analyzer::Constant::do_cast(), RelAlgExecutor::executeSimpleInsert(), get_agg_initial_val(), get_array_context_logical_size(), anonymous_namespace{TargetExprBuilder.cpp}::get_initial_agg_val(), Catalog_Namespace::Catalog::getColumnDictDirectory(), Importer_NS::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_real_str_or_array(), is_supported_type_for_extern_execution(), Fragmenter_Namespace::isStringVectorData(), ResultSet::makeTargetValue(), ResultSet::makeVarlenTargetValue(), Parser::CaseExpr::normalize(), null_val_bit_pattern(), Importer_NS::NullArray(), numeric_type_name(), Parser::InsertIntoTableAsSelectStmt::populateData(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), ResultSetReductionJIT::reduceOneSlot(), ResultSetStorage::reduceOneSlot(), ddl_utils::set_default_encoding(), Importer_NS::StringToArray(), Importer_NS::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(), and Analyzer::Constant::~Constant().

409 { return IS_STRING(type); }
#define IS_STRING(T)
Definition: sqltypes.h:172
SQLTypes type
Definition: sqltypes.h:650
bool SQLTypeInfo::is_string_array ( ) const
inline

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

410 { return (type == kARRAY) && IS_STRING(subtype); }
SQLTypes subtype
Definition: sqltypes.h:651
#define IS_STRING(T)
Definition: sqltypes.h:172
SQLTypes type
Definition: sqltypes.h:650

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_timeinterval ( ) const
inline
bool SQLTypeInfo::is_timestamp ( ) const
inline

Definition at line 647 of file sqltypes.h.

References kTIMESTAMP, and type.

Referenced by CodeGenerator::codegenCast(), anonymous_namespace{ExpressionRange.cpp}::getDateTimePrecisionCastRange(), and Parser::InsertIntoTableAsSelectStmt::populateData().

647 { return type == kTIMESTAMP; }
SQLTypes type
Definition: sqltypes.h:650

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_varlen ( ) const
inline

Definition at line 423 of file sqltypes.h.

References compression, IS_GEO, IS_STRING, kARRAY, kENCODING_DICT, and type.

Referenced by Chunk_NS::Chunk::createChunkBuffer(), get_agg_type(), Chunk_NS::Chunk::getChunkBuffer(), Chunk_NS::Chunk::getNumElemsForBytesInsertData(), Chunk_NS::Chunk::initEncoder(), is_varlen_indeed(), Chunk_NS::Chunk::isChunkOnDevice(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), ResultSetReductionJIT::reduceOneSlot(), ResultSetStorage::reduceOneSlot(), ResultSetStorage::reduceOneSlotBaseline(), and ResultSetStorage::reduceOneSlotSingleValue().

423  { // TODO: logically this should ignore fixlen arrays
424  return (IS_STRING(type) && compression != kENCODING_DICT) || type == kARRAY ||
425  IS_GEO(type);
426  }
EncodingType compression
Definition: sqltypes.h:655
#define IS_STRING(T)
Definition: sqltypes.h:172
SQLTypes type
Definition: sqltypes.h:650
#define IS_GEO(T)
Definition: sqltypes.h:173

+ Here is the caller graph for this function:

bool SQLTypeInfo::is_varlen_array ( ) const
inline

Definition at line 418 of file sqltypes.h.

References kARRAY, size, and type.

418 { return type == kARRAY && size <= 0; }
SQLTypes type
Definition: sqltypes.h:650
bool SQLTypeInfo::is_varlen_indeed ( ) const
inline

Definition at line 429 of file sqltypes.h.

References is_fixlen_array(), and is_varlen().

429  {
430  // SQLTypeInfo.is_varlen() is broken with fixedlen array now
431  // and seems left broken for some concern, so fix it locally
432  return is_varlen() && !is_fixlen_array();
433  }
bool is_varlen() const
Definition: sqltypes.h:423
bool is_fixlen_array() const
Definition: sqltypes.h:419

+ Here is the call graph for this function:

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

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

443  {
444  return type != rhs.get_type() || subtype != rhs.get_subtype() ||
445  dimension != rhs.get_dimension() || scale != rhs.get_scale() ||
446  compression != rhs.get_compression() ||
449  notnull != rhs.get_notnull();
450  }
HOST DEVICE SQLTypes get_subtype() const
Definition: sqltypes.h:259
HOST DEVICE int get_scale() const
Definition: sqltypes.h:263
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:258
SQLTypes subtype
Definition: sqltypes.h:651
bool notnull
Definition: sqltypes.h:654
EncodingType compression
Definition: sqltypes.h:655
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:266
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:260
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:267
SQLTypes type
Definition: sqltypes.h:650
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:265
#define TRANSIENT_DICT(ID)
Definition: sqltypes.h:198
int comp_param
Definition: sqltypes.h:656
int dimension
Definition: sqltypes.h:652

+ Here is the call graph for this function:

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

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

471  {
472  type = rhs.get_type();
473  subtype = rhs.get_subtype();
474  dimension = rhs.get_dimension();
475  scale = rhs.get_scale();
476  notnull = rhs.get_notnull();
478  comp_param = rhs.get_comp_param();
479  size = rhs.get_size();
480  }
HOST DEVICE SQLTypes get_subtype() const
Definition: sqltypes.h:259
HOST DEVICE int get_size() const
Definition: sqltypes.h:268
HOST DEVICE int get_scale() const
Definition: sqltypes.h:263
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:258
SQLTypes subtype
Definition: sqltypes.h:651
bool notnull
Definition: sqltypes.h:654
EncodingType compression
Definition: sqltypes.h:655
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:266
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:260
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:267
SQLTypes type
Definition: sqltypes.h:650
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:265
int comp_param
Definition: sqltypes.h:656
int dimension
Definition: sqltypes.h:652

+ Here is the call graph for this function:

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

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

451  {
452  return type == rhs.get_type() && subtype == rhs.get_subtype() &&
453  dimension == rhs.get_dimension() && scale == rhs.get_scale() &&
454  compression == rhs.get_compression() &&
457  notnull == rhs.get_notnull();
458  }
HOST DEVICE SQLTypes get_subtype() const
Definition: sqltypes.h:259
HOST DEVICE int get_scale() const
Definition: sqltypes.h:263
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:258
SQLTypes subtype
Definition: sqltypes.h:651
bool notnull
Definition: sqltypes.h:654
EncodingType compression
Definition: sqltypes.h:655
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:266
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:260
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:267
SQLTypes type
Definition: sqltypes.h:650
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:265
#define TRANSIENT_DICT(ID)
Definition: sqltypes.h:198
int comp_param
Definition: sqltypes.h:656
int dimension
Definition: sqltypes.h:652

+ Here is the call graph for this function:

void SQLTypeInfo::set_dimension ( int  d)
inline

Definition at line 350 of file sqltypes.h.

References dimension.

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

350 { dimension = d; }
int dimension
Definition: sqltypes.h:652

+ Here is the caller graph for this function:

void SQLTypeInfo::set_fixed_size ( )
inline

Definition at line 357 of file sqltypes.h.

References get_storage_size(), and size.

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

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

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

References dimension.

Referenced by Importer_NS::Importer::gdalToColumnDescriptors(), Geo_namespace::GeoTypesFactory::getGeoColumns(), RelAlgTranslator::translateGeoFunctionArg(), RelAlgTranslator::translateGeoLiteral(), and ddl_utils::validate_and_set_type().

352 { dimension = d; }
int dimension
Definition: sqltypes.h:652

+ Here is the caller graph for this function:

void SQLTypeInfo::set_notnull ( bool  n)
inline

Definition at line 355 of file sqltypes.h.

References notnull.

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

355 { notnull = n; }
bool notnull
Definition: sqltypes.h:654

+ Here is the caller graph for this function:

void SQLTypeInfo::set_output_srid ( int  s)
inline

Definition at line 354 of file sqltypes.h.

References scale.

Referenced by Importer_NS::Importer::gdalToColumnDescriptors(), Geo_namespace::GeoTypesFactory::getGeoColumns(), RelAlgTranslator::translateGeoFunctionArg(), RelAlgTranslator::translateGeoLiteral(), and ddl_utils::validate_and_set_type().

354 { scale = s; }

+ Here is the caller graph for this function:

void SQLTypeInfo::set_precision ( int  d)
inline

Definition at line 351 of file sqltypes.h.

References dimension.

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

351 { dimension = d; }
int dimension
Definition: sqltypes.h:652

+ Here is the caller graph for this function:

void SQLTypeInfo::set_scale ( int  s)
inline
void SQLTypeInfo::set_size ( int  s)
inline

Definition at line 356 of file sqltypes.h.

References size.

Referenced by Catalog_Namespace::Catalog::buildMaps(), Catalog_Namespace::Catalog::createTable(), Catalog_Namespace::Catalog::expandGeoColumn(), File_Namespace::FileBuffer::readMetadata(), Catalog_Namespace::Catalog::setColumnDictionary(), RelAlgTranslator::translateGeoLiteral(), and ddl_utils::validate_and_set_array_size().

356 { size = s; }

+ Here is the caller graph for this function:

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

Definition at line 349 of file sqltypes.h.

References subtype.

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

349 { subtype = st; }
SQLTypes subtype
Definition: sqltypes.h:651

+ Here is the caller graph for this function:

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

Definition at line 348 of file sqltypes.h.

References type.

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

348 { type = t; }
SQLTypes type
Definition: sqltypes.h:650

+ Here is the caller graph for this function:

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

Definition at line 387 of file sqltypes.h.

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

Referenced by operator<<().

387  {
388  return concat("(",
389  type_name[static_cast<int>(type)],
390  ", ",
391  get_dimension(),
392  ", ",
393  get_scale(),
394  ", ",
395  get_notnull() ? "not nullable" : "nullable",
396  ", ",
398  ", ",
399  get_comp_param(),
400  ", ",
401  type_name[static_cast<int>(subtype)],
402  ": ",
403  get_size(),
404  ": ",
406  ")");
407  }
HOST DEVICE int get_size() const
Definition: sqltypes.h:268
HOST DEVICE int get_scale() const
Definition: sqltypes.h:263
std::string get_compression_name() const
Definition: sqltypes.h:386
std::string concat(Types &&...parms)
static std::string type_name[kSQLTYPE_LAST]
Definition: sqltypes.h:659
SQLTypes subtype
Definition: sqltypes.h:651
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:260
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:267
SQLTypes type
Definition: sqltypes.h:650
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:265
SQLTypeInfo get_elem_type() const
Definition: sqltypes.h:617

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

Referenced by get_compression_name().

int SQLTypeInfo::comp_param
private
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"}

Definition at line 659 of file sqltypes.h.

Referenced by get_type_name(), and to_string().


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