OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sqltypes.h File Reference

Constants for Builtin SQL Types supported by HEAVY.AI. More...

#include "toString.h"
#include "../Logger/Logger.h"
#include "../QueryEngine/Utils/FlatBuffer.h"
#include "Datum.h"
#include "funcannotations.h"
#include "sqltypes_lite.h"
#include <cassert>
#include <ctime>
#include <memory>
#include <ostream>
#include <sstream>
#include <string>
#include <type_traits>
#include <vector>
#include "Shared/DbObjectKeys.h"
#include "InlineNullValues.h"
#include <string_view>
#include "../QueryEngine/DateAdd.h"
#include "../QueryEngine/DateTruncate.h"
#include "../QueryEngine/ExtractFromTime.h"
+ Include dependency graph for sqltypes.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  DoNothingDeleter
 
struct  FreeDeleter
 
struct  HostArrayDatum
 
struct  DeviceArrayDatum
 
union  DataBlockPtr
 
class  SQLTypeInfo
 
union  null_value_t
 
struct  SqlLiteralArg
 

Namespaces

 sql_constants
 

Macros

#define IS_INTEGER(T)   (((T) == kINT) || ((T) == kSMALLINT) || ((T) == kBIGINT) || ((T) == kTINYINT))
 
#define IS_NUMBER(T)
 
#define IS_STRING(T)   (((T) == kTEXT) || ((T) == kVARCHAR) || ((T) == kCHAR))
 
#define IS_GEO(T)
 
#define IS_INTERVAL(T)   ((T) == kINTERVAL_DAY_TIME || (T) == kINTERVAL_YEAR_MONTH)
 
#define IS_DECIMAL(T)   ((T) == kNUMERIC || (T) == kDECIMAL)
 
#define IS_GEO_POLY(T)   (((T) == kPOLYGON) || ((T) == kMULTIPOLYGON))
 
#define IS_GEO_LINE(T)   (((T) == kLINESTRING) || ((T) == kMULTILINESTRING))
 
#define IS_GEO_MULTI(T)   (((T) == kMULTIPOLYGON) || ((T) == kMULTILINESTRING) || ((T) == kMULTIPOINT))
 
#define TRANSIENT_DICT(ID)   (-(ID))
 
#define REGULAR_DICT(TRANSIENTID)   (-(TRANSIENTID))
 

Typedefs

using ArrayDatum = std::conditional_t< is_cuda_compiler(), DeviceArrayDatum, HostArrayDatum >
 
using StringOffsetT = int32_t
 
using ArrayOffsetT = int32_t
 

Enumerations

enum  SQLTypes {
  kNULLT = 0, kBOOLEAN = 1, kCHAR = 2, kVARCHAR = 3,
  kNUMERIC = 4, kDECIMAL = 5, kINT = 6, kSMALLINT = 7,
  kFLOAT = 8, kDOUBLE = 9, kTIME = 10, kTIMESTAMP = 11,
  kBIGINT = 12, kTEXT = 13, kDATE = 14, kARRAY = 15,
  kINTERVAL_DAY_TIME = 16, kINTERVAL_YEAR_MONTH = 17, kPOINT = 18, kLINESTRING = 19,
  kPOLYGON = 20, kMULTIPOLYGON = 21, kTINYINT = 22, kGEOMETRY = 23,
  kGEOGRAPHY = 24, kEVAL_CONTEXT_TYPE = 25, kVOID = 26, kCURSOR = 27,
  kCOLUMN = 28, kCOLUMN_LIST = 29, kMULTILINESTRING = 30, kMULTIPOINT = 31,
  kSQLTYPE_LAST = 32
}
 
enum  EncodingType {
  kENCODING_NONE = 0, kENCODING_FIXED = 1, kENCODING_RL = 2, kENCODING_DIFF = 3,
  kENCODING_DICT = 4, kENCODING_SPARSE = 5, kENCODING_GEOINT = 6, kENCODING_DATE_IN_DAYS = 7,
  kENCODING_ARRAY = 8, kENCODING_ARRAY_DICT = 9, kENCODING_LAST = 10
}
 

Functions

std::string toString (const SQLTypes &type)
 
std::ostream & operator<< (std::ostream &os, SQLTypes const sql_type)
 
DEVICE constexpr bool is_cuda_compiler ()
 
std::ostream & operator<< (std::ostream &os, EncodingType const type)
 
std::string toString (const EncodingType &type)
 
constexpr auto is_datetime (SQLTypes type)
 
SQLTypes decimal_to_int_type (const SQLTypeInfo &)
 
SQLTypes string_dict_to_int_type (const SQLTypeInfo &)
 
Datum NullDatum (const SQLTypeInfo &ti)
 
bool IsNullDatum (const Datum d, const SQLTypeInfo &ti)
 
Datum StringToDatum (const std::string_view s, SQLTypeInfo &ti)
 
std::string DatumToString (const Datum d, const SQLTypeInfo &ti)
 
int64_t extract_int_type_from_datum (const Datum datum, const SQLTypeInfo &ti)
 
double extract_fp_type_from_datum (const Datum datum, const SQLTypeInfo &ti)
 
bool DatumEqual (const Datum, const Datum, const SQLTypeInfo &ti)
 
int64_t convert_decimal_value_to_scale (const int64_t decimal_value, const SQLTypeInfo &type_info, const SQLTypeInfo &new_type_info)
 
std::ostream & operator<< (std::ostream &os, const SQLTypeInfo &type_info)
 
SQLTypes get_int_type_by_size (size_t const nbytes)
 
SQLTypeInfo get_logical_type_info (const SQLTypeInfo &type_info)
 
SQLTypeInfo get_nullable_type_info (const SQLTypeInfo &type_info)
 
SQLTypeInfo get_nullable_logical_type_info (const SQLTypeInfo &type_info)
 
int8_t * append_datum (int8_t *buf, const Datum &d, const SQLTypeInfo &ti)
 
auto generate_column_type (const SQLTypeInfo &elem_ti)
 
auto generate_column_list_type (const SQLTypeInfo &elem_ti)
 
DEVICE void VarlenArray_get_nth (int8_t *buf, int n, ArrayDatum *result, bool *is_end)
 
DEVICE void VarlenArray_get_nth (int8_t *buf, int n, bool uncompress, VarlenDatum *result, bool *is_end)
 
void getFlatBufferNDimsAndSizes (const int64_t items_count, const int64_t max_nof_values, const SQLTypeInfo &ti, size_t &ndims, int64_t &max_nof_sizes)
 
int64_t getFlatBufferSize (int64_t items_count, int64_t max_nof_values, const SQLTypeInfo &ti)
 
null_value_t get_null_value (const SQLTypeInfo &ti)
 
void initializeFlatBuffer (FlatBufferManager &m, int64_t items_count, int64_t max_nof_values, const SQLTypeInfo &ti)
 
bool geo_promoted_type_match (const SQLTypes a, const SQLTypes b)
 

Variables

static constexpr int32_t sql_constants::kMaxNumericPrecision
 
static constexpr int32_t sql_constants::kMaxRepresentableNumericPrecision
 

Detailed Description

Constants for Builtin SQL Types supported by HEAVY.AI.

Definition in file sqltypes.h.

Macro Definition Documentation

#define IS_DECIMAL (   T)    ((T) == kNUMERIC || (T) == kDECIMAL)

Definition at line 314 of file sqltypes.h.

#define IS_GEO (   T)
Value:
(((T) == kPOINT) || ((T) == kLINESTRING) || ((T) == kMULTILINESTRING) || \
((T) == kMULTIPOINT) || ((T) == kPOLYGON) || ((T) == kMULTIPOLYGON))

Definition at line 310 of file sqltypes.h.

Referenced by spatial_type::Distance::codegenLoads(), RelAlgExecutor::createTableFunctionWorkUnit(), Catalog_Namespace::Catalog::expandGeoColumn(), SQLTypeInfo::get_elem_type(), SQLTypeInfo::get_type_name(), Executor::getColLazyFetchInfo(), anonymous_namespace{DdlCommandExecutor.cpp}::JsonColumnSqlType::getParam1(), anonymous_namespace{DdlCommandExecutor.cpp}::JsonColumnSqlType::getParam2(), EmbeddedDatabase::DBEngineImpl::getTableDetails(), import_export::import_thread_delimited(), SQLTypeInfo::is_geometry(), SQLTypeInfo::is_varlen(), ResultSet::isGeoColOnGpu(), DBHandler::populateThriftColumnType(), foreign_storage::TextFileBufferParser::processGeoColumn(), foreign_storage::TextFileBufferParser::processInvalidGeoColumn(), ThriftSerializers::target_meta_info_to_thrift(), thrift_to_name(), SQLTypeInfo::transforms(), RelAlgTranslator::translateGeoColumn(), RelAlgTranslator::translateGeoFunctionArg(), RelAlgTranslator::translateUnaryGeoFunction(), type_info_from_thrift(), ThriftSerializers::type_info_to_thrift(), ddl_utils::validate_and_set_type(), and anonymous_namespace{RelAlgExecutor.cpp}::RexUsedInputsVisitor::visitInput().

#define IS_GEO_LINE (   T)    (((T) == kLINESTRING) || ((T) == kMULTILINESTRING))

Definition at line 316 of file sqltypes.h.

#define IS_GEO_MULTI (   T)    (((T) == kMULTIPOLYGON) || ((T) == kMULTILINESTRING) || ((T) == kMULTIPOINT))

Definition at line 317 of file sqltypes.h.

Referenced by spatial_type::NumGeometries::codegenLoads().

#define IS_GEO_POLY (   T)    (((T) == kPOLYGON) || ((T) == kMULTIPOLYGON))
#define IS_INTERVAL (   T)    ((T) == kINTERVAL_DAY_TIME || (T) == kINTERVAL_YEAR_MONTH)

Definition at line 313 of file sqltypes.h.

Referenced by SQLTypeInfo::is_timeinterval().

#define IS_NUMBER (   T)
Value:
(((T) == kINT) || ((T) == kSMALLINT) || ((T) == kDOUBLE) || ((T) == kFLOAT) || \
((T) == kBIGINT) || ((T) == kNUMERIC) || ((T) == kDECIMAL) || ((T) == kTINYINT))
Definition: sqltypes.h:72

Definition at line 306 of file sqltypes.h.

Referenced by generate_column_type(), SQLTypeInfo::is_number(), and anonymous_namespace{EquiJoinCondition.cpp}::make_composite_equals_impl().

#define REGULAR_DICT (   TRANSIENTID)    (-(TRANSIENTID))

Definition at line 323 of file sqltypes.h.

Referenced by RowSetMemoryOwner::getOrAddStringDictProxy().

Typedef Documentation

Definition at line 229 of file sqltypes.h.

using ArrayOffsetT = int32_t

Definition at line 1496 of file sqltypes.h.

using StringOffsetT = int32_t

Definition at line 1495 of file sqltypes.h.

Enumeration Type Documentation

Enumerator
kENCODING_NONE 
kENCODING_FIXED 
kENCODING_RL 
kENCODING_DIFF 
kENCODING_DICT 
kENCODING_SPARSE 
kENCODING_GEOINT 
kENCODING_DATE_IN_DAYS 
kENCODING_ARRAY 
kENCODING_ARRAY_DICT 
kENCODING_LAST 

Definition at line 240 of file sqltypes.h.

240  {
241  kENCODING_NONE = 0, // no encoding
242  kENCODING_FIXED = 1, // Fixed-bit encoding
243  kENCODING_RL = 2, // Run Length encoding
244  kENCODING_DIFF = 3, // Differential encoding
245  kENCODING_DICT = 4, // Dictionary encoding
246  kENCODING_SPARSE = 5, // Null encoding for sparse columns
247  kENCODING_GEOINT = 6, // Encoding coordinates as intergers
248  kENCODING_DATE_IN_DAYS = 7, // Date encoding in days
249  kENCODING_ARRAY = 8, // Array encoding for columns of arrays
250  kENCODING_ARRAY_DICT = 9, // Array encoding for columns of text encoding dict arrays
251  kENCODING_LAST = 10
252 };
enum SQLTypes
Enumerator
kNULLT 
kBOOLEAN 
kCHAR 
kVARCHAR 
kNUMERIC 
kDECIMAL 
kINT 
kSMALLINT 
kFLOAT 
kDOUBLE 
kTIME 
kTIMESTAMP 
kBIGINT 
kTEXT 
kDATE 
kARRAY 
kINTERVAL_DAY_TIME 
kINTERVAL_YEAR_MONTH 
kPOINT 
kLINESTRING 
kPOLYGON 
kMULTIPOLYGON 
kTINYINT 
kGEOMETRY 
kGEOGRAPHY 
kEVAL_CONTEXT_TYPE 
kVOID 
kCURSOR 
kCOLUMN 
kCOLUMN_LIST 
kMULTILINESTRING 
kMULTIPOINT 
kSQLTYPE_LAST 

Definition at line 65 of file sqltypes.h.

65  {
66  kNULLT = 0, // type for null values
67  kBOOLEAN = 1,
68  kCHAR = 2,
69  kVARCHAR = 3,
70  kNUMERIC = 4,
71  kDECIMAL = 5,
72  kINT = 6,
73  kSMALLINT = 7,
74  kFLOAT = 8,
75  kDOUBLE = 9,
76  kTIME = 10,
77  kTIMESTAMP = 11,
78  kBIGINT = 12,
79  kTEXT = 13,
80  kDATE = 14,
81  kARRAY = 15,
82  kINTERVAL_DAY_TIME = 16,
84  kPOINT = 18,
85  kLINESTRING = 19,
86  kPOLYGON = 20,
87  kMULTIPOLYGON = 21,
88  kTINYINT = 22,
89  kGEOMETRY = 23,
90  kGEOGRAPHY = 24,
91  kEVAL_CONTEXT_TYPE = 25, // Placeholder Type for ANY
92  kVOID = 26,
93  kCURSOR = 27,
94  kCOLUMN = 28,
95  kCOLUMN_LIST = 29,
96  kMULTILINESTRING = 30,
97  kMULTIPOINT = 31,
98  kSQLTYPE_LAST = 32
99 };
Definition: sqltypes.h:76
Definition: sqltypes.h:92
Definition: sqltypes.h:79
Definition: sqltypes.h:80
Definition: sqltypes.h:68
Definition: sqltypes.h:72

Function Documentation

int8_t* append_datum ( int8_t *  buf,
const Datum d,
const SQLTypeInfo ti 
)

Definition at line 580 of file Datum.cpp.

References Datum::bigintval, Datum::boolval, Datum::doubleval, Datum::floatval, SQLTypeInfo::get_type(), Datum::intval, SQLTypeInfo::is_dict_encoded_string(), kBIGINT, kBOOLEAN, kDATE, kDECIMAL, kDOUBLE, kFLOAT, kINT, kNUMERIC, kSMALLINT, kTIME, kTIMESTAMP, kTINYINT, Datum::smallintval, string_dict_to_int_type(), Datum::tinyintval, run_benchmark_import::type, and UNREACHABLE.

Referenced by RelAlgExecutor::executeSimpleInsert(), import_export::NullArray(), import_export::StringToArray(), and import_export::TDatumToArrayDatum().

580  {
581  SQLTypes type;
582  if (ti.is_dict_encoded_string()) {
583  type = string_dict_to_int_type(ti);
584  } else {
585  type = ti.get_type();
586  }
587  switch (type) {
588  case kBOOLEAN:
589  *(int8_t*)buf = d.boolval;
590  return buf + sizeof(int8_t);
591  case kNUMERIC:
592  case kDECIMAL:
593  case kBIGINT:
594  *(int64_t*)buf = d.bigintval;
595  return buf + sizeof(int64_t);
596  case kINT:
597  *(int32_t*)buf = d.intval;
598  return buf + sizeof(int32_t);
599  case kSMALLINT:
600  *(int16_t*)buf = d.smallintval;
601  return buf + sizeof(int16_t);
602  case kTINYINT:
603  *(int8_t*)buf = d.tinyintval;
604  return buf + sizeof(int8_t);
605  case kFLOAT:
606  *(float*)buf = d.floatval;
607  return buf + sizeof(float);
608  case kDOUBLE:
609  *(double*)buf = d.doubleval;
610  return buf + sizeof(double);
611  case kTIME:
612  case kTIMESTAMP:
613  case kDATE:
614  *reinterpret_cast<int64_t*>(buf) = d.bigintval;
615  return buf + sizeof(int64_t);
616  default:
617  UNREACHABLE() << "Unexpected type: " << type;
618  return nullptr;
619  }
620 }
int8_t tinyintval
Definition: Datum.h:73
Definition: sqltypes.h:76
SQLTypes
Definition: sqltypes.h:65
int8_t boolval
Definition: Datum.h:72
#define UNREACHABLE()
Definition: Logger.h:338
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:391
int32_t intval
Definition: Datum.h:75
float floatval
Definition: Datum.h:77
int64_t bigintval
Definition: Datum.h:76
int16_t smallintval
Definition: Datum.h:74
Definition: sqltypes.h:80
bool is_dict_encoded_string() const
Definition: sqltypes.h:643
Definition: sqltypes.h:72
double doubleval
Definition: Datum.h:78
SQLTypes string_dict_to_int_type(const SQLTypeInfo &ti)
Definition: Datum.cpp:565

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int64_t convert_decimal_value_to_scale ( const int64_t  decimal_value,
const SQLTypeInfo type_info,
const SQLTypeInfo new_type_info 
)

Definition at line 624 of file Datum.cpp.

References anonymous_namespace{Datum.cpp}::convert_decimal_value_to_scale_internal(), and SQLTypeInfo::get_scale().

Referenced by import_export::TypedImportBuffer::addDefaultValues(), Analyzer::Constant::cast_number(), anonymous_namespace{ArrowImporter.h}::ArrowValue< arrow::Decimal128 >::operator DATA_TYPE(), parse_numeric(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), and ddl_utils::anonymous_namespace{DdlUtils.cpp}::validate_literal().

626  {
627  int const dscale = new_type_info.get_scale() - type_info.get_scale();
628  return convert_decimal_value_to_scale_internal(decimal_value, dscale);
629 }
HOST DEVICE int get_scale() const
Definition: sqltypes.h:396
int64_t convert_decimal_value_to_scale_internal(const int64_t decimal_value, int const dscale)
Definition: Datum.cpp:81

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool DatumEqual ( const Datum  ,
const Datum  ,
const SQLTypeInfo ti 
)

Definition at line 408 of file Datum.cpp.

References Datum::bigintval, Datum::boolval, Datum::doubleval, Datum::floatval, SQLTypeInfo::get_compression(), SQLTypeInfo::get_type(), Datum::intval, kBIGINT, kBOOLEAN, kCHAR, kDATE, kDECIMAL, kDOUBLE, kENCODING_DICT, kFLOAT, kINT, kINTERVAL_DAY_TIME, kINTERVAL_YEAR_MONTH, kLINESTRING, kMULTILINESTRING, kMULTIPOINT, kMULTIPOLYGON, kNUMERIC, kPOINT, kPOLYGON, kSMALLINT, kTEXT, kTIME, kTIMESTAMP, kTINYINT, kVARCHAR, Datum::smallintval, Datum::stringval, and Datum::tinyintval.

Referenced by IsNullDatum(), ChunkMetadata::operator==(), FixedLengthArrayNoneEncoder::resetChunkStats(), and ArrayNoneEncoder::resetChunkStats().

408  {
409  switch (ti.get_type()) {
410  case kBOOLEAN:
411  return a.boolval == b.boolval;
412  case kBIGINT:
413  case kNUMERIC:
414  case kDECIMAL:
415  return a.bigintval == b.bigintval;
416  case kINT:
417  return a.intval == b.intval;
418  case kSMALLINT:
419  return a.smallintval == b.smallintval;
420  case kTINYINT:
421  return a.tinyintval == b.tinyintval;
422  case kFLOAT:
423  return a.floatval == b.floatval;
424  case kDOUBLE:
425  return a.doubleval == b.doubleval;
426  case kTIME:
427  case kTIMESTAMP:
428  case kDATE:
429  case kINTERVAL_DAY_TIME:
431  return a.bigintval == b.bigintval;
432  case kTEXT:
433  case kVARCHAR:
434  case kCHAR:
435  case kPOINT:
436  case kMULTIPOINT:
437  case kLINESTRING:
438  case kMULTILINESTRING:
439  case kPOLYGON:
440  case kMULTIPOLYGON:
441  if (ti.get_compression() == kENCODING_DICT) {
442  return a.intval == b.intval;
443  }
444  if (a.stringval == nullptr && b.stringval == nullptr) {
445  return true;
446  }
447  if (a.stringval == nullptr || b.stringval == nullptr) {
448  return false;
449  }
450  return *a.stringval == *b.stringval;
451  default:
452  return false;
453  }
454  return false;
455 }
Definition: sqltypes.h:76
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:391
constexpr double a
Definition: Utm.h:32
Definition: sqltypes.h:79
Definition: sqltypes.h:80
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399
Definition: sqltypes.h:68
Definition: sqltypes.h:72

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string DatumToString ( const Datum  d,
const SQLTypeInfo ti 
)

Definition at line 460 of file Datum.cpp.

References Datum::bigintval, Datum::boolval, CHECK_EQ, CHECK_LE, CHECK_LT, Datum::doubleval, Datum::floatval, shared::formatDate(), shared::formatDateTime(), shared::formatHMS(), SQLTypeInfo::get_dimension(), SQLTypeInfo::get_scale(), SQLTypeInfo::get_type(), SQLTypeInfo::get_type_name(), Datum::intval, kBIGINT, kBOOLEAN, kCHAR, kDATE, kDECIMAL, kDOUBLE, kFLOAT, kINT, kINTERVAL_DAY_TIME, kINTERVAL_YEAR_MONTH, kNUMERIC, kSMALLINT, kTEXT, kTIME, kTIMESTAMP, kTINYINT, kVARCHAR, Datum::smallintval, Datum::stringval, Datum::tinyintval, to_string(), and SQLTypeInfo::to_string().

Referenced by anonymous_namespace{TableFunctionExecutionContext.cpp}::append_literal_buffer(), Analyzer::Constant::cast_to_string(), foreign_storage::datetime_to_string(), foreign_storage::TypedParquetInPlaceEncoder< V, V >::integralTypeToString(), anonymous_namespace{ArrowImporter.h}::ArrowValue< int64_t >::operator DATA_TYPE(), operator<<(), import_export::anonymous_namespace{QueryExporterCSV.cpp}::target_value_to_string(), Analyzer::Constant::toString(), Timestamp::toString(), Fragmenter_Namespace::InsertOrderFragmenter::updateChunkStats(), and ScalarExprToSql::visitConstant().

460  {
461  constexpr size_t buf_size = 64;
462  char buf[buf_size]; // Hold "2000-03-01 12:34:56.123456789" and large years.
463  switch (ti.get_type()) {
464  case kBOOLEAN:
465  if (d.boolval) {
466  return "t";
467  }
468  return "f";
469  case kNUMERIC:
470  case kDECIMAL: {
471  double v = (double)d.bigintval / pow(10, ti.get_scale());
472  int size = snprintf(buf, buf_size, "%*.*f", ti.get_dimension(), ti.get_scale(), v);
473  CHECK_LE(0, size) << v << ' ' << ti.to_string();
474  CHECK_LT(size_t(size), buf_size) << v << ' ' << ti.to_string();
475  return buf;
476  }
477  case kINT:
478  return std::to_string(d.intval);
479  case kSMALLINT:
480  return std::to_string(d.smallintval);
481  case kTINYINT:
482  return std::to_string(d.tinyintval);
483  case kBIGINT:
484  return std::to_string(d.bigintval);
485  case kFLOAT:
486  return std::to_string(d.floatval);
487  case kDOUBLE:
488  return std::to_string(d.doubleval);
489  case kTIME: {
490  size_t const len = shared::formatHMS(buf, buf_size, d.bigintval);
491  CHECK_EQ(8u, len); // 8 == strlen("HH:MM:SS")
492  return buf;
493  }
494  case kTIMESTAMP: {
495  unsigned const dim = ti.get_dimension(); // assumes dim <= 9
496  size_t const len = shared::formatDateTime(buf, buf_size, d.bigintval, dim);
497  CHECK_LE(19u + bool(dim) + dim, len); // 19 = strlen("YYYY-MM-DD HH:MM:SS")
498  return buf;
499  }
500  case kDATE: {
501  size_t const len = shared::formatDate(buf, buf_size, d.bigintval);
502  CHECK_LE(10u, len); // 10 == strlen("YYYY-MM-DD")
503  return buf;
504  }
505  case kINTERVAL_DAY_TIME:
506  return std::to_string(d.bigintval) + " ms (day-time interval)";
508  return std::to_string(d.bigintval) + " month(s) (year-month interval)";
509  case kTEXT:
510  case kVARCHAR:
511  case kCHAR:
512  if (d.stringval == nullptr) {
513  return "NULL";
514  }
515  return *d.stringval;
516  default:
517  throw std::runtime_error("Internal error: invalid type " + ti.get_type_name() +
518  " in DatumToString.");
519  }
520  return "";
521 }
int8_t tinyintval
Definition: Datum.h:73
#define CHECK_EQ(x, y)
Definition: Logger.h:301
Definition: sqltypes.h:76
HOST DEVICE int get_scale() const
Definition: sqltypes.h:396
int8_t boolval
Definition: Datum.h:72
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:391
int32_t intval
Definition: Datum.h:75
std::string to_string(char const *&&v)
size_t formatHMS(char *buf, size_t const max, int64_t const unixtime)
Definition: misc.cpp:98
float floatval
Definition: Datum.h:77
std::string to_string() const
Definition: sqltypes.h:528
int64_t bigintval
Definition: Datum.h:76
int16_t smallintval
Definition: Datum.h:74
std::string * stringval
Definition: Datum.h:81
size_t formatDate(char *buf, size_t const max, int64_t const unixtime)
Definition: misc.cpp:29
#define CHECK_LT(x, y)
Definition: Logger.h:303
Definition: sqltypes.h:79
Definition: sqltypes.h:80
#define CHECK_LE(x, y)
Definition: Logger.h:304
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:393
std::string get_type_name() const
Definition: sqltypes.h:484
size_t formatDateTime(char *buf, size_t const max, int64_t const timestamp, int const dimension, bool use_iso_format)
Definition: misc.cpp:47
Definition: sqltypes.h:68
Definition: sqltypes.h:72
double doubleval
Definition: Datum.h:78

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double extract_fp_type_from_datum ( const Datum  datum,
const SQLTypeInfo ti 
)

Definition at line 549 of file Datum.cpp.

References Datum::doubleval, Datum::floatval, SQLTypeInfo::get_type(), kDOUBLE, kFLOAT, and run_benchmark_import::type.

Referenced by extract_max_stat_fp_type(), and extract_min_stat_fp_type().

549  {
550  const auto type = ti.get_type();
551  switch (type) {
552  case kFLOAT:
553  return datum.floatval;
554  case kDOUBLE:
555  return datum.doubleval;
556  default:
557  abort();
558  }
559 }
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:391
float floatval
Definition: Datum.h:77
double doubleval
Definition: Datum.h:78

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int64_t extract_int_type_from_datum ( const Datum  datum,
const SQLTypeInfo ti 
)

Definition at line 523 of file Datum.cpp.

References Datum::bigintval, CHECK_EQ, decimal_to_int_type(), SQLTypeInfo::get_compression(), SQLTypeInfo::get_type(), Datum::intval, SQLTypeInfo::is_decimal(), kBIGINT, kBOOLEAN, kCHAR, kDATE, kENCODING_DICT, kINT, kSMALLINT, kTEXT, kTIME, kTIMESTAMP, kTINYINT, kVARCHAR, Datum::smallintval, Datum::tinyintval, and run_benchmark_import::type.

Referenced by extract_max_stat_int_type(), extract_min_stat_int_type(), StringOps_Namespace::StringOpInfo::getIntLiteral(), ChunkMetadata::isPlaceholder(), and StringOps_Namespace::operator<<().

523  {
524  const auto type = ti.is_decimal() ? decimal_to_int_type(ti) : ti.get_type();
525  switch (type) {
526  case kBOOLEAN:
527  return datum.tinyintval;
528  case kTINYINT:
529  return datum.tinyintval;
530  case kSMALLINT:
531  return datum.smallintval;
532  case kCHAR:
533  case kVARCHAR:
534  case kTEXT:
536  case kINT:
537  return datum.intval;
538  case kBIGINT:
539  return datum.bigintval;
540  case kTIME:
541  case kTIMESTAMP:
542  case kDATE:
543  return datum.bigintval;
544  default:
545  abort();
546  }
547 }
int8_t tinyintval
Definition: Datum.h:73
#define CHECK_EQ(x, y)
Definition: Logger.h:301
Definition: sqltypes.h:76
int32_t intval
Definition: Datum.h:75
int64_t bigintval
Definition: Datum.h:76
int16_t smallintval
Definition: Datum.h:74
SQLTypes decimal_to_int_type(const SQLTypeInfo &ti)
Definition: Datum.cpp:561
Definition: sqltypes.h:79
Definition: sqltypes.h:80
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399
Definition: sqltypes.h:68
Definition: sqltypes.h:72
bool is_decimal() const
Definition: sqltypes.h:570

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

auto generate_column_list_type ( const SQLTypeInfo elem_ti)
inline

Definition at line 1701 of file sqltypes.h.

References generate_column_type(), kCOLUMN_LIST, kNULLT, and kTIMESTAMP.

Referenced by bind_function().

1701  {
1702  auto type_info = generate_column_type(elem_ti);
1703  if (type_info.get_subtype() != kNULLT) {
1704  type_info.set_type(kCOLUMN_LIST);
1705  }
1706  if (type_info.get_subtype() == kTIMESTAMP) {
1707  // ColumnList<Timestamp> is not supported, see QE-472
1708  type_info.set_subtype(kNULLT);
1709  }
1710  return type_info;
1711 }
auto generate_column_type(const SQLTypeInfo &elem_ti)
Definition: sqltypes.h:1629

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

auto generate_column_type ( const SQLTypeInfo elem_ti)
inline

Definition at line 1629 of file sqltypes.h.

References SQLTypeInfo::get_comp_param(), SQLTypeInfo::get_compression(), SQLTypeInfo::get_dimension(), SQLTypeInfo::get_scale(), SQLTypeInfo::get_subtype(), SQLTypeInfo::get_type(), SQLTypeInfo::getStringDictKey(), IS_NUMBER, kARRAY, kBIGINT, kBOOLEAN, kCOLUMN, kDOUBLE, kENCODING_ARRAY, kENCODING_ARRAY_DICT, kENCODING_DICT, kENCODING_GEOINT, kENCODING_NONE, kFLOAT, kINT, kLINESTRING, kMULTILINESTRING, kMULTIPOINT, kMULTIPOLYGON, kNULLT, kPOINT, kPOLYGON, kSMALLINT, kTEXT, kTIMESTAMP, kTINYINT, kVARCHAR, and SQLTypeInfo::set_subtype().

Referenced by bind_function(), and generate_column_list_type().

1629  {
1630  SQLTypes elem_type = elem_ti.get_type();
1631  if (elem_type == kCOLUMN) {
1632  if (elem_ti.get_subtype() == kVARCHAR) {
1633  auto new_elem_ti = elem_ti;
1634  new_elem_ti.set_subtype(kTEXT);
1635  return new_elem_ti;
1636  }
1637  return elem_ti;
1638  }
1639  auto c = elem_ti.get_compression();
1640  auto d = elem_ti.get_dimension();
1641  auto s = elem_ti.get_scale();
1642  auto p = elem_ti.get_comp_param();
1643  switch (elem_type) {
1644  case kBOOLEAN:
1645  case kTINYINT:
1646  case kSMALLINT:
1647  case kINT:
1648  case kBIGINT:
1649  case kFLOAT:
1650  case kDOUBLE:
1651  if (c == kENCODING_NONE && p == 0) {
1652  break; // here and below `break` means supported element type
1653  // for extension functions
1654  }
1655  case kPOINT:
1656  case kLINESTRING:
1657  case kPOLYGON:
1658  case kMULTIPOINT:
1659  case kMULTILINESTRING:
1660  case kMULTIPOLYGON:
1661  if (c == kENCODING_NONE && p == 0) {
1662  break;
1663  }
1664  if (c == kENCODING_GEOINT && p == 32) {
1665  break;
1666  }
1667  case kTEXT:
1668  case kVARCHAR:
1669  elem_type = kTEXT;
1670  if (c == kENCODING_DICT) {
1671  break;
1672  }
1673  case kTIMESTAMP:
1674  if (c == kENCODING_NONE && p == 0 && (d == 9 || d == 6 || d == 0)) {
1675  break;
1676  }
1677  case kARRAY:
1678  elem_type = elem_ti.get_subtype();
1679  if (IS_NUMBER(elem_type) || elem_type == kBOOLEAN || elem_type == kTEXT) {
1680  if (c == kENCODING_NONE && p == 0) {
1681  c = kENCODING_ARRAY;
1682  break;
1683  } else if (c == kENCODING_DICT) {
1685  break;
1686  }
1687  }
1688  default:
1689  elem_type = kNULLT; // indicates unsupported element type that
1690  // the caller needs to handle accordingly
1691  }
1692  auto ti = SQLTypeInfo(kCOLUMN, c, p, elem_type);
1693  ti.set_dimension(d);
1694  if (c == kENCODING_DICT) {
1695  ti.setStringDictKey(elem_ti.getStringDictKey());
1696  }
1697  ti.set_scale(s);
1698  return ti;
1699 }
HOST DEVICE SQLTypes get_subtype() const
Definition: sqltypes.h:392
SQLTypes
Definition: sqltypes.h:65
HOST DEVICE int get_scale() const
Definition: sqltypes.h:396
HOST DEVICE void set_subtype(SQLTypes st)
Definition: sqltypes.h:471
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:391
Definition: sqltypes.h:79
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:393
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:402
Definition: sqltypes.h:72
#define IS_NUMBER(T)
Definition: sqltypes.h:306
const shared::StringDictKey & getStringDictKey() const
Definition: sqltypes.h:1057

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool geo_promoted_type_match ( const SQLTypes  a,
const SQLTypes  b 
)
inline

Definition at line 2031 of file sqltypes.h.

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

Referenced by Parser::InsertValuesStmt::analyze(), Geospatial::GeoTypesFactory::getGeoColumns(), import_export::import_thread_delimited(), import_export::import_thread_shapefile(), foreign_storage::TextFileBufferParser::processGeoColumn(), and foreign_storage::GeospatialEncoder::processGeoElement().

2031  {
2032  return (a == b) || (a == kPOINT && b == kMULTIPOINT) ||
2033  (a == kLINESTRING && b == kMULTILINESTRING) ||
2034  (a == kPOLYGON && b == kMULTIPOLYGON);
2035 }
constexpr double a
Definition: Utm.h:32

+ Here is the caller graph for this function:

SQLTypes get_int_type_by_size ( size_t const  nbytes)
inline

Definition at line 1454 of file sqltypes.h.

References kBIGINT, kINT, kSMALLINT, kTINYINT, and UNREACHABLE.

Referenced by WindowFunctionContext::buildAggregationTreeForPartition(), anonymous_namespace{RelAlgExecutor.cpp}::anonymous_namespace{RelAlgExecutor.cpp}::conditionally_change_arg_to_int_type(), and decimal_to_int_type().

1454  {
1455  switch (nbytes) {
1456  case 1:
1457  return kTINYINT;
1458  case 2:
1459  return kSMALLINT;
1460  case 4:
1461  return kINT;
1462  case 8:
1463  return kBIGINT;
1464  default:
1465 #if !(defined(__CUDACC__) || defined(NO_BOOST))
1466  UNREACHABLE() << "Invalid number of bytes=" << nbytes;
1467 #endif
1468  return {};
1469  }
1470 }
#define UNREACHABLE()
Definition: Logger.h:338
Definition: sqltypes.h:72

+ Here is the caller graph for this function:

SQLTypeInfo get_logical_type_info ( const SQLTypeInfo type_info)
inline

Definition at line 1472 of file sqltypes.h.

References SQLTypeInfo::get_compression(), SQLTypeInfo::get_type(), kARRAY, kENCODING_DATE_IN_DAYS, kENCODING_FIXED, kENCODING_NONE, and SQLTypeInfo::set_compression().

Referenced by anonymous_namespace{ColumnFetcher.cpp}::columnarize_result(), anonymous_namespace{ColumnarResults.cpp}::fixed_encoding_nullable_val(), anonymous_namespace{RelAlgExecutor.cpp}::get_logical_type_for_expr(), anonymous_namespace{TypedDataAccessors.h}::NullSentinelSupplier::get_null_sentinel_for_type(), get_nullable_logical_type_info(), target_info::get_target_info_impl(), TableOptimizer::getDeletedColumnStats(), PerfectJoinHashTable::getHashJoinArgs(), getLeafColumnRange(), Parser::CaseExpr::normalize(), TableOptimizer::recomputeColumnMetadata(), Fragmenter_Namespace::InsertOrderFragmenter::updateChunkStats(), and Fragmenter_Namespace::InsertOrderFragmenter::updateColumns().

1472  {
1473  EncodingType encoding = type_info.get_compression();
1474  if (encoding == kENCODING_DATE_IN_DAYS ||
1475  (encoding == kENCODING_FIXED && type_info.get_type() != kARRAY)) {
1476  encoding = kENCODING_NONE;
1477  }
1478  auto type_info_copy = type_info;
1479  type_info_copy.set_compression(encoding);
1480  type_info_copy.setStorageSize();
1481  return type_info_copy;
1482 }
void set_compression(EncodingType c)
Definition: sqltypes.h:481
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:391
EncodingType
Definition: sqltypes.h:240
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

null_value_t get_null_value ( const SQLTypeInfo ti)
inline

Definition at line 1893 of file sqltypes.h.

References CHECK_EQ, SQLTypeInfo::get_compression(), SQLTypeInfo::get_logical_size(), SQLTypeInfo::get_subtype(), SQLTypeInfo::get_type(), kARRAY, kBIGINT, kBOOLEAN, kDATE, kDECIMAL, kDOUBLE, kENCODING_DICT, kENCODING_GEOINT, kENCODING_NONE, kFLOAT, kINT, kINTERVAL_DAY_TIME, kINTERVAL_YEAR_MONTH, kLINESTRING, kMULTILINESTRING, kMULTIPOINT, kMULTIPOLYGON, kNUMERIC, kPOINT, kPOLYGON, kSMALLINT, kTEXT, kTIME, kTIMESTAMP, kTINYINT, NULL_ARRAY_BIGINT, NULL_ARRAY_BOOLEAN, NULL_ARRAY_COMPRESSED_32, NULL_ARRAY_DOUBLE, NULL_ARRAY_FLOAT, NULL_ARRAY_INT, NULL_ARRAY_SMALLINT, NULL_ARRAY_TINYINT, NULL_BIGINT, NULL_BOOLEAN, NULL_DOUBLE, NULL_FLOAT, NULL_INT, NULL_SMALLINT, NULL_TINYINT, and UNREACHABLE.

1893  {
1894  null_value_t null_value{};
1895  switch (ti.get_type()) {
1896  case kBOOLEAN:
1897  null_value.i8 = NULL_BOOLEAN;
1898  break;
1899  case kTINYINT:
1900  null_value.i8 = NULL_TINYINT;
1901  break;
1902  case kSMALLINT:
1903  null_value.i16 = NULL_SMALLINT;
1904  break;
1905  case kINT:
1906  null_value.i32 = NULL_INT;
1907  break;
1908  case kBIGINT:
1909  null_value.i64 = NULL_BIGINT;
1910  break;
1911  case kFLOAT:
1912  null_value.f32 = NULL_FLOAT;
1913  break;
1914  case kDOUBLE:
1915  null_value.f64 = NULL_DOUBLE;
1916  break;
1917  case kPOINT:
1918  case kMULTIPOINT:
1919  case kLINESTRING:
1920  case kMULTILINESTRING:
1921  case kPOLYGON:
1922  case kMULTIPOLYGON:
1923  if (ti.get_compression() == kENCODING_GEOINT) {
1924  null_value.geoint[0] = null_value.geoint[1] = NULL_ARRAY_COMPRESSED_32;
1925  } else if (ti.get_compression() == kENCODING_NONE) {
1926  null_value.geodouble[0] = null_value.geodouble[1] = NULL_ARRAY_DOUBLE;
1927  } else {
1928  UNREACHABLE();
1929  }
1930  break;
1931  case kARRAY:
1932  switch (ti.get_subtype()) {
1933  case kBOOLEAN:
1934  null_value.i8 = NULL_ARRAY_BOOLEAN;
1935  break;
1936  case kTINYINT:
1937  null_value.i8 = NULL_ARRAY_TINYINT;
1938  break;
1939  case kSMALLINT:
1940  null_value.i16 = NULL_ARRAY_SMALLINT;
1941  break;
1942  case kINT:
1943  null_value.i32 = NULL_ARRAY_INT;
1944  break;
1945  case kTIMESTAMP:
1946  case kTIME:
1947  case kDATE:
1948  case kINTERVAL_DAY_TIME:
1949  case kINTERVAL_YEAR_MONTH:
1950  case kDECIMAL:
1951  case kNUMERIC:
1952  case kBIGINT:
1953  null_value.i64 = NULL_ARRAY_BIGINT;
1954  break;
1955  case kFLOAT:
1956  null_value.f32 = NULL_ARRAY_FLOAT;
1957  break;
1958  case kDOUBLE:
1959  null_value.f64 = NULL_ARRAY_FLOAT;
1960  break;
1961  case kTEXT:
1962  if (ti.get_compression() == kENCODING_DICT) {
1963  CHECK_EQ(ti.get_logical_size(), 4);
1964  null_value.i32 = NULL_ARRAY_COMPRESSED_32;
1965  } else if (ti.get_compression() == kENCODING_NONE) {
1966  null_value.i8 = NULL_ARRAY_TINYINT;
1967  } else {
1968  UNREACHABLE();
1969  }
1970  break;
1971  default:
1972  UNREACHABLE();
1973  break;
1974  }
1975  break;
1976  case kTEXT:
1977  if (ti.get_compression() == kENCODING_DICT) {
1978  CHECK_EQ(ti.get_logical_size(), 4);
1979  null_value.i32 = NULL_INT;
1980  } else if (ti.get_compression() == kENCODING_NONE) {
1981  null_value.i32 = NULL_TINYINT;
1982  } else {
1983  UNREACHABLE();
1984  }
1985  break;
1986  default:
1987  UNREACHABLE();
1988  break;
1989  }
1990  return null_value;
1991 }
HOST DEVICE SQLTypes get_subtype() const
Definition: sqltypes.h:392
#define CHECK_EQ(x, y)
Definition: Logger.h:301
#define NULL_DOUBLE
Definition: sqltypes.h:76
#define NULL_ARRAY_INT
#define NULL_FLOAT
#define NULL_BIGINT
#define NULL_ARRAY_SMALLINT
#define UNREACHABLE()
Definition: Logger.h:338
#define NULL_ARRAY_TINYINT
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:391
#define NULL_INT
int get_logical_size() const
Definition: sqltypes.h:421
#define NULL_ARRAY_COMPRESSED_32
#define NULL_ARRAY_FLOAT
#define NULL_BOOLEAN
Definition: sqltypes.h:79
Definition: sqltypes.h:80
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399
#define NULL_TINYINT
#define NULL_ARRAY_DOUBLE
#define NULL_SMALLINT
#define NULL_ARRAY_BIGINT
Definition: sqltypes.h:72
#define NULL_ARRAY_BOOLEAN

+ Here is the call graph for this function:

SQLTypeInfo get_nullable_logical_type_info ( const SQLTypeInfo type_info)
inline

Definition at line 1490 of file sqltypes.h.

References get_logical_type_info(), and get_nullable_type_info().

Referenced by anonymous_namespace{RelAlgExecutor.cpp}::get_logical_type_for_expr(), and RelAlgTranslator::translateArrayFunction().

1490  {
1491  SQLTypeInfo nullable_type_info = get_logical_type_info(type_info);
1492  return get_nullable_type_info(nullable_type_info);
1493 }
SQLTypeInfo get_logical_type_info(const SQLTypeInfo &type_info)
Definition: sqltypes.h:1472
SQLTypeInfo get_nullable_type_info(const SQLTypeInfo &type_info)
Definition: sqltypes.h:1484

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

SQLTypeInfo get_nullable_type_info ( const SQLTypeInfo type_info)
inline

Definition at line 1484 of file sqltypes.h.

References SQLTypeInfo::set_notnull().

Referenced by CodeGenerator::createInValuesBitmap(), Analyzer::Constant::do_cast(), and get_nullable_logical_type_info().

1484  {
1485  SQLTypeInfo nullable_type_info = type_info;
1486  nullable_type_info.set_notnull(false);
1487  return nullable_type_info;
1488 }
void set_notnull(bool n)
Definition: sqltypes.h:477

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void getFlatBufferNDimsAndSizes ( const int64_t  items_count,
const int64_t  max_nof_values,
const SQLTypeInfo ti,
size_t &  ndims,
int64_t &  max_nof_sizes 
)
inline

Definition at line 1789 of file sqltypes.h.

References SQLTypeInfo::get_compression(), SQLTypeInfo::get_subtype(), SQLTypeInfo::get_type(), kARRAY, kENCODING_DICT, kENCODING_NONE, kLINESTRING, kMULTILINESTRING, kMULTIPOINT, kMULTIPOLYGON, kPOINT, kPOLYGON, kTEXT, and UNREACHABLE.

Referenced by getFlatBufferSize(), and initializeFlatBuffer().

1793  {
1794  ndims = 0;
1795  max_nof_sizes = 0;
1796  switch (ti.get_type()) {
1797  case kPOINT:
1798  ndims = 0;
1799  break;
1800  case kARRAY:
1801  if (ti.get_subtype() == kTEXT && ti.get_compression() == kENCODING_NONE) {
1802  ndims = 2;
1803  max_nof_sizes = items_count + 2 * max_nof_values / 3;
1804  } else {
1805  ndims = 1;
1806  max_nof_sizes = items_count + max_nof_values / 3;
1807  }
1808  break;
1809  case kLINESTRING:
1810  case kMULTIPOINT:
1811  ndims = 1;
1812  max_nof_sizes = items_count + max_nof_values / 3;
1813  break;
1814  case kPOLYGON:
1815  case kMULTILINESTRING:
1816  ndims = 2;
1817  max_nof_sizes = items_count + 2 * max_nof_values / 3;
1818  break;
1819  case kMULTIPOLYGON:
1820  ndims = 3;
1821  max_nof_sizes = items_count + max_nof_values;
1822  break;
1823  case kTEXT:
1824  switch (ti.get_compression()) {
1825  case kENCODING_NONE:
1826  ndims = 1;
1827  max_nof_sizes = items_count + max_nof_values / 3;
1828  break;
1829  case kENCODING_DICT:
1830  ndims = 0;
1831  break;
1832  default:
1833  UNREACHABLE();
1834  }
1835  break;
1836  default:
1837  UNREACHABLE();
1838  }
1839 }
HOST DEVICE SQLTypes get_subtype() const
Definition: sqltypes.h:392
#define UNREACHABLE()
Definition: Logger.h:338
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:391
Definition: sqltypes.h:79
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int64_t getFlatBufferSize ( int64_t  items_count,
int64_t  max_nof_values,
const SQLTypeInfo ti 
)
inline

Definition at line 1841 of file sqltypes.h.

References FlatBufferManager::compute_flatbuffer_size(), FlatBufferManager::computeBufferSizeNestedArray(), GeoPointFormatId, SQLTypeInfo::get_compression(), SQLTypeInfo::get_input_srid(), SQLTypeInfo::get_output_srid(), SQLTypeInfo::get_type(), getFlatBufferNDimsAndSizes(), kENCODING_GEOINT, kPOINT, and SQLTypeInfo::toValueType().

Referenced by TableFunctionManager::allocate_output_buffers(), and ColumnarResults::ColumnarResults().

1843  {
1844  if (ti.get_type() == kPOINT) {
1845  // to be deprecated
1846  FlatBufferManager::GeoPoint metadata{items_count,
1847  ti.get_input_srid(),
1848  ti.get_output_srid(),
1851  GeoPointFormatId, reinterpret_cast<const int8_t*>(&metadata));
1852  } else {
1853  size_t ndims = 0;
1854  int64_t max_nof_sizes = 0;
1855  getFlatBufferNDimsAndSizes(items_count, max_nof_values, ti, ndims, max_nof_sizes);
1857  /* ndims= */ ndims,
1858  /* total_items_count= */ items_count,
1859  /* total sizes count= */ max_nof_sizes,
1860  /* total values count= */ max_nof_values,
1861  ti.toValueType(),
1862  /* user data size= */ sizeof(SQLTypeInfoLite));
1863  }
1864 }
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:391
FlatBufferManager::ValueType toValueType() const
Definition: sqltypes.h:1227
static int64_t compute_flatbuffer_size(FlatBufferFormat format_id, const int8_t *format_metadata_ptr)
Definition: FlatBuffer.h:639
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399
static int64_t computeBufferSizeNestedArray(int64_t ndims, int64_t total_items_count, int64_t total_sizes_count, int64_t total_values_count, ValueType value_type, size_t user_data_size)
Definition: FlatBuffer.h:718
void getFlatBufferNDimsAndSizes(const int64_t items_count, const int64_t max_nof_values, const SQLTypeInfo &ti, size_t &ndims, int64_t &max_nof_sizes)
Definition: sqltypes.h:1789
HOST DEVICE int get_input_srid() const
Definition: sqltypes.h:395
HOST DEVICE int get_output_srid() const
Definition: sqltypes.h:397

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void initializeFlatBuffer ( FlatBufferManager m,
int64_t  items_count,
int64_t  max_nof_values,
const SQLTypeInfo ti 
)
inline

Definition at line 1993 of file sqltypes.h.

References CHECK_EQ, GeoPointFormatId, SQLTypeInfo::get_compression(), SQLTypeInfo::get_input_srid(), get_null_value(), SQLTypeInfo::get_output_srid(), SQLTypeInfo::get_type(), getFlatBufferNDimsAndSizes(), null_value_t::i8, FlatBufferManager::initialize(), FlatBufferManager::initializeNestedArray(), kENCODING_GEOINT, kPOINT, FlatBufferManager::Success, SQLTypeInfo::toLite(), and SQLTypeInfo::toValueType().

Referenced by TableFunctionManager::allocate_output_buffers(), and ColumnarResults::ColumnarResults().

1996  {
1997  if (ti.get_type() == kPOINT) {
1998  // to be deprecated
1999  FlatBufferManager::GeoPoint metadata{items_count,
2000  ti.get_input_srid(),
2001  ti.get_output_srid(),
2003  m.initialize(GeoPointFormatId, reinterpret_cast<const int8_t*>(&metadata));
2004  } else {
2005  size_t ndims = 0;
2006  int64_t max_nof_sizes = 0;
2007  getFlatBufferNDimsAndSizes(items_count, max_nof_values, ti, ndims, max_nof_sizes);
2008  SQLTypeInfoLite ti_lite = ti.toLite();
2009  null_value_t null_value = get_null_value(ti);
2010  int8_t* null_value_ptr = &null_value.i8;
2011  auto status = m.initializeNestedArray(
2012  /* ndims= */ ndims,
2013  /* total_items_count= */ items_count,
2014  /* total_sizes_count= */ max_nof_sizes,
2015  /* total_values_count= */ max_nof_values,
2016  ti.toValueType(),
2017  /* null value buffer=*/null_value_ptr, // null value buffer size
2018  // is defined by value type
2019  /* user data buffer=*/reinterpret_cast<const int8_t*>(&ti_lite),
2020  /* user data buffer size=*/sizeof(SQLTypeInfoLite));
2022  }
2023 }
#define CHECK_EQ(x, y)
Definition: Logger.h:301
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:391
void initialize(FlatBufferFormat format_id, const int8_t *format_metadata_ptr)
Definition: FlatBuffer.h:833
FlatBufferManager::ValueType toValueType() const
Definition: sqltypes.h:1227
int8_t i8
Definition: sqltypes.h:1868
SQLTypeInfoLite toLite() const
Definition: sqltypes.h:1109
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399
Status initializeNestedArray(int64_t ndims, int64_t total_items_count, int64_t total_sizes_count, int64_t total_values_count, ValueType value_type, const int8_t *null_value_ptr, const int8_t *user_data_ptr, size_t user_data_size)
Definition: FlatBuffer.h:743
void getFlatBufferNDimsAndSizes(const int64_t items_count, const int64_t max_nof_values, const SQLTypeInfo &ti, size_t &ndims, int64_t &max_nof_sizes)
Definition: sqltypes.h:1789
HOST DEVICE int get_input_srid() const
Definition: sqltypes.h:395
V get_null_value()
HOST DEVICE int get_output_srid() const
Definition: sqltypes.h:397

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DEVICE constexpr bool is_cuda_compiler ( )
inline

Definition at line 220 of file sqltypes.h.

220  {
221 #ifdef __CUDACC__
222  return true;
223 #else
224  return false;
225 #endif
226 }
constexpr auto is_datetime ( SQLTypes  type)

Definition at line 325 of file sqltypes.h.

References kDATE, kTIME, and kTIMESTAMP.

Referenced by ColumnDescriptor::getDefaultValueLiteral(), SQLTypeInfo::is_time(), ArrowForeignStorageBase::replaceNullValues(), RexLiteral::RexLiteral(), and ddl_utils::validate_and_set_fixed_encoding().

325  {
326  return type == kTIME || type == kTIMESTAMP || type == kDATE;
327 }
Definition: sqltypes.h:76
Definition: sqltypes.h:80

+ Here is the caller graph for this function:

bool IsNullDatum ( const Datum  d,
const SQLTypeInfo ti 
)

Definition at line 331 of file Datum.cpp.

References DatumEqual(), and NullDatum().

Referenced by anonymous_namespace{ExpressionRewrite.cpp}::ConstantFoldingVisitor::visitStringOper().

331  {
332  const Datum null_datum = NullDatum(ti);
333  return DatumEqual(datum, null_datum, ti);
334 }
bool DatumEqual(const Datum a, const Datum b, const SQLTypeInfo &ti)
Definition: Datum.cpp:408
Datum NullDatum(const SQLTypeInfo &ti)
Definition: Datum.cpp:288
Definition: Datum.h:71

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Datum NullDatum ( const SQLTypeInfo ti)

Definition at line 288 of file Datum.cpp.

References Datum::bigintval, Datum::boolval, Datum::doubleval, Datum::floatval, import_export::anonymous_namespace{Importer.cpp}::get_type_for_datum(), inline_fixed_encoding_null_val(), Datum::intval, kBIGINT, kBOOLEAN, kDATE, kDOUBLE, kFLOAT, kINT, kLINESTRING, kMULTILINESTRING, kMULTIPOINT, kMULTIPOLYGON, kPOINT, kPOLYGON, kSMALLINT, kTIME, kTIMESTAMP, kTINYINT, NULL_DOUBLE, NULL_FLOAT, Datum::smallintval, Datum::tinyintval, and run_benchmark_import::type.

Referenced by StringOps_Namespace::compute_jaro_winkler_score(), IsNullDatum(), import_export::NullArray(), and import_export::StringToArray().

288  {
289  Datum d;
290  const auto type = get_type_for_datum(ti);
291  switch (type) {
292  case kBOOLEAN:
294  break;
295  case kBIGINT:
297  break;
298  case kINT:
300  break;
301  case kSMALLINT:
303  break;
304  case kTINYINT:
306  break;
307  case kFLOAT:
308  d.floatval = NULL_FLOAT;
309  break;
310  case kDOUBLE:
312  break;
313  case kTIME:
314  case kTIMESTAMP:
315  case kDATE:
317  break;
318  case kPOINT:
319  case kMULTIPOINT:
320  case kLINESTRING:
321  case kMULTILINESTRING:
322  case kPOLYGON:
323  case kMULTIPOLYGON:
324  throw std::runtime_error("Internal error: geometry type in NullDatum.");
325  default:
326  throw std::runtime_error("Internal error: invalid type in NullDatum.");
327  }
328  return d;
329 }
int8_t tinyintval
Definition: Datum.h:73
#define NULL_DOUBLE
Definition: sqltypes.h:76
#define NULL_FLOAT
int8_t boolval
Definition: Datum.h:72
int32_t intval
Definition: Datum.h:75
float floatval
Definition: Datum.h:77
int64_t bigintval
Definition: Datum.h:76
int16_t smallintval
Definition: Datum.h:74
Definition: sqltypes.h:80
int64_t inline_fixed_encoding_null_val(const SQL_TYPE_INFO &ti)
Definition: sqltypes.h:72
SQLTypes get_type_for_datum(const SQLTypeInfo &ti)
Definition: Importer.cpp:260
Definition: Datum.h:71
double doubleval
Definition: Datum.h:78

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::ostream& operator<< ( std::ostream &  os,
SQLTypes const  sql_type 
)
inline

Definition at line 176 of file sqltypes.h.

References toString().

176  {
177  os << toString(sql_type);
178  return os;
179 }
std::string toString(const Executor::ExtModuleKinds &kind)
Definition: Execute.h:1703

+ Here is the call graph for this function:

std::ostream& operator<< ( std::ostream &  os,
EncodingType const  type 
)
inline

Definition at line 256 of file sqltypes.h.

References logger::FATAL, kENCODING_ARRAY, kENCODING_ARRAY_DICT, kENCODING_DATE_IN_DAYS, kENCODING_DICT, kENCODING_DIFF, kENCODING_FIXED, kENCODING_GEOINT, kENCODING_LAST, kENCODING_NONE, kENCODING_RL, kENCODING_SPARSE, LOG, and run_benchmark_import::type.

256  {
257  switch (type) {
258  case kENCODING_NONE:
259  os << "NONE";
260  break;
261  case kENCODING_FIXED:
262  os << "FIXED";
263  break;
264  case kENCODING_RL:
265  os << "RL";
266  break;
267  case kENCODING_DIFF:
268  os << "DIFF";
269  break;
270  case kENCODING_DICT:
271  os << "DICT";
272  break;
273  case kENCODING_SPARSE:
274  os << "SPARSE";
275  break;
276  case kENCODING_GEOINT:
277  os << "GEOINT";
278  break;
280  os << "DATE_IN_DAYS";
281  break;
282  case kENCODING_ARRAY:
283  os << "ARRAY";
284  break;
286  os << "ARRAY_DICT";
287  break;
288  case kENCODING_LAST:
289  break;
290  default:
291  LOG(FATAL) << "Invalid EncodingType: " << type;
292  }
293  return os;
294 }
#define LOG(tag)
Definition: Logger.h:285
std::ostream& operator<< ( std::ostream &  os,
const SQLTypeInfo type_info 
)
inline

Definition at line 1444 of file sqltypes.h.

References toString().

1444  {
1445  os << toString(type_info);
1446  return os;
1447 }
std::string toString(const Executor::ExtModuleKinds &kind)
Definition: Execute.h:1703

+ Here is the call graph for this function:

SQLTypes string_dict_to_int_type ( const SQLTypeInfo )

Definition at line 565 of file Datum.cpp.

References CHECK, SQLTypeInfo::get_size(), SQLTypeInfo::is_dict_encoded_string(), kINT, kNULLT, kSMALLINT, kTINYINT, and UNREACHABLE.

Referenced by append_datum(), import_export::anonymous_namespace{Importer.cpp}::get_type_for_datum(), anonymous_namespace{Datum.cpp}::get_type_for_datum(), and foreign_storage::ParquetFixedLengthArrayEncoder::setNullFixedLengthArraySentinel().

565  {
566  CHECK(ti.is_dict_encoded_string());
567  switch (ti.get_size()) {
568  case 1:
569  return kTINYINT;
570  case 2:
571  return kSMALLINT;
572  case 4:
573  return kINT;
574  default:
575  UNREACHABLE() << "Unexpected string dictionary encoding size: " << ti.get_size();
576  }
577  return kNULLT;
578 }
#define UNREACHABLE()
Definition: Logger.h:338
#define CHECK(condition)
Definition: Logger.h:291
Definition: sqltypes.h:72

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Datum StringToDatum ( const std::string_view  s,
SQLTypeInfo ti 
)

Definition at line 339 of file Datum.cpp.

References Datum::bigintval, Datum::boolval, Datum::doubleval, Datum::floatval, SQLTypeInfo::get_dimension(), SQLTypeInfo::get_type(), SQLTypeInfo::get_type_name(), Datum::intval, kARRAY, kBIGINT, kBOOLEAN, kCOLUMN, kCOLUMN_LIST, kDATE, kDECIMAL, kDOUBLE, kFLOAT, kINT, kLINESTRING, kMULTILINESTRING, kMULTIPOINT, kMULTIPOLYGON, kNUMERIC, kPOINT, kPOLYGON, kSMALLINT, kTIME, kTIMESTAMP, kTINYINT, parse_numeric(), Datum::smallintval, Datum::tinyintval, and to_upper().

Referenced by import_export::TypedImportBuffer::add_value(), import_export::TypedImportBuffer::addDefaultValues(), Parser::FixedPtLiteral::analyze(), Analyzer::Constant::cast_from_string(), data_conversion::StringViewToScalarEncoder< DataType, MetadataType >::convert(), anonymous_namespace{ArrowImporter.h}::ArrowValue< std::string >::operator DATA_TYPE(), populate_TColumn(), import_export::StringToArray(), and ddl_utils::anonymous_namespace{DdlUtils.cpp}::validate_literal().

339  {
340  Datum d;
341  try {
342  switch (ti.get_type()) {
343  case kARRAY:
344  case kCOLUMN:
345  case kCOLUMN_LIST:
346  break;
347  case kBOOLEAN:
348  if (s == "t" || s == "T" || s == "1" || to_upper(std::string(s)) == "TRUE") {
349  d.boolval = true;
350  } else if (s == "f" || s == "F" || s == "0" ||
351  to_upper(std::string(s)) == "FALSE") {
352  d.boolval = false;
353  } else {
354  throw std::runtime_error("Invalid string for boolean " + std::string(s));
355  }
356  break;
357  case kNUMERIC:
358  case kDECIMAL:
359  d.bigintval = parse_numeric(s, ti);
360  break;
361  case kBIGINT:
362  d.bigintval = parseInteger<int64_t>(s, ti);
363  break;
364  case kINT:
365  d.intval = parseInteger<int32_t>(s, ti);
366  break;
367  case kSMALLINT:
368  d.smallintval = parseInteger<int16_t>(s, ti);
369  break;
370  case kTINYINT:
371  d.tinyintval = parseInteger<int8_t>(s, ti);
372  break;
373  case kFLOAT:
374  d.floatval = std::stof(std::string(s));
375  break;
376  case kDOUBLE:
377  d.doubleval = std::stod(std::string(s));
378  break;
379  case kTIME:
380  d.bigintval = dateTimeParse<kTIME>(s, ti.get_dimension());
381  break;
382  case kTIMESTAMP:
383  d.bigintval = dateTimeParse<kTIMESTAMP>(s, ti.get_dimension());
384  break;
385  case kDATE:
386  d.bigintval = dateTimeParse<kDATE>(s, ti.get_dimension());
387  break;
388  case kPOINT:
389  case kMULTIPOINT:
390  case kLINESTRING:
391  case kMULTILINESTRING:
392  case kPOLYGON:
393  case kMULTIPOLYGON:
394  throw std::runtime_error("Internal error: geometry type in StringToDatum.");
395  default:
396  throw std::runtime_error("Internal error: invalid type in StringToDatum: " +
397  ti.get_type_name());
398  }
399  } catch (const std::invalid_argument&) {
400  throw std::runtime_error("Invalid conversion from string to " + ti.get_type_name());
401  } catch (const std::out_of_range&) {
402  throw std::runtime_error("Got out of range error during conversion from string to " +
403  ti.get_type_name());
404  }
405  return d;
406 }
int8_t tinyintval
Definition: Datum.h:73
Definition: sqltypes.h:76
int64_t parse_numeric(const std::string_view s, SQLTypeInfo &ti)
Definition: Datum.cpp:112
int8_t boolval
Definition: Datum.h:72
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:391
int32_t intval
Definition: Datum.h:75
float floatval
Definition: Datum.h:77
int64_t bigintval
Definition: Datum.h:76
int16_t smallintval
Definition: Datum.h:74
std::string to_upper(const std::string &str)
Definition: sqltypes.h:80
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:393
std::string get_type_name() const
Definition: sqltypes.h:484
Definition: sqltypes.h:72
Definition: Datum.h:71
double doubleval
Definition: Datum.h:78

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string toString ( const SQLTypes type)
inline

Definition at line 103 of file sqltypes.h.

References logger::FATAL, kARRAY, kBIGINT, kBOOLEAN, kCHAR, kCOLUMN, kCOLUMN_LIST, kCURSOR, kDATE, kDECIMAL, kDOUBLE, kEVAL_CONTEXT_TYPE, kFLOAT, kGEOGRAPHY, kGEOMETRY, kINT, kINTERVAL_DAY_TIME, kINTERVAL_YEAR_MONTH, kLINESTRING, kMULTILINESTRING, kMULTIPOINT, kMULTIPOLYGON, kNULLT, kNUMERIC, kPOINT, kPOLYGON, kSMALLINT, kSQLTYPE_LAST, kTEXT, kTIME, kTIMESTAMP, kTINYINT, kVARCHAR, kVOID, LOG, and run_benchmark_import::type.

103  {
104  switch (type) {
105  case kNULLT:
106  return "NULL";
107  case kBOOLEAN:
108  return "BOOL";
109  case kCHAR:
110  return "CHAR";
111  case kVARCHAR:
112  return "VARCHAR";
113  case kNUMERIC:
114  return "NUMERIC";
115  case kDECIMAL:
116  return "DECIMAL";
117  case kINT:
118  return "INT";
119  case kSMALLINT:
120  return "SMALLINT";
121  case kFLOAT:
122  return "FLOAT";
123  case kDOUBLE:
124  return "DOUBLE";
125  case kTIME:
126  return "TIME";
127  case kTIMESTAMP:
128  return "TIMESTAMP";
129  case kBIGINT:
130  return "BIGINT";
131  case kTEXT:
132  return "TEXT";
133  case kDATE:
134  return "DATE";
135  case kARRAY:
136  return "ARRAY";
137  case kINTERVAL_DAY_TIME:
138  return "DAY TIME INTERVAL";
140  return "YEAR MONTH INTERVAL";
141  case kPOINT:
142  return "POINT";
143  case kMULTIPOINT:
144  return "MULTIPOINT";
145  case kLINESTRING:
146  return "LINESTRING";
147  case kMULTILINESTRING:
148  return "MULTILINESTRING";
149  case kPOLYGON:
150  return "POLYGON";
151  case kMULTIPOLYGON:
152  return "MULTIPOLYGON";
153  case kTINYINT:
154  return "TINYINT";
155  case kGEOMETRY:
156  return "GEOMETRY";
157  case kGEOGRAPHY:
158  return "GEOGRAPHY";
159  case kEVAL_CONTEXT_TYPE:
160  return "UNEVALUATED ANY";
161  case kVOID:
162  return "VOID";
163  case kCURSOR:
164  return "CURSOR";
165  case kCOLUMN:
166  return "COLUMN";
167  case kCOLUMN_LIST:
168  return "COLUMN_LIST";
169  case kSQLTYPE_LAST:
170  break;
171  }
172  LOG(FATAL) << "Invalid SQL type: " << type;
173  return "";
174 }
Definition: sqltypes.h:76
#define LOG(tag)
Definition: Logger.h:285
Definition: sqltypes.h:92
Definition: sqltypes.h:79
Definition: sqltypes.h:80
Definition: sqltypes.h:68
Definition: sqltypes.h:72
std::string toString ( const EncodingType type)
inline

Definition at line 296 of file sqltypes.h.

References run_benchmark_import::type.

296  {
297  std::ostringstream ss;
298  ss << type;
299  return ss.str();
300 }
DEVICE void VarlenArray_get_nth ( int8_t *  buf,
int  n,
ArrayDatum result,
bool *  is_end 
)
inline

Definition at line 1716 of file sqltypes.h.

References CHECK_EQ, FlatBufferManager::NestedArrayItem< NDIM >::is_null, FlatBufferManager::NestedArrayItem< NDIM >::nof_values, and FlatBufferManager::NestedArrayItem< NDIM >::values.

Referenced by ChunkIter_get_nth(), ChunkIter_get_nth_varlen(), and ResultSet::makeVarlenTargetValue().

1719  {
1720  FlatBufferManager m{buf};
1721  FlatBufferManager::Status status{};
1722  if (m.isNestedArray()) {
1724  status = m.getItem(n, item);
1725  if (status == FlatBufferManager::Status::Success) {
1726  result->length = item.nof_values * m.getValueSize();
1727  result->pointer = item.values;
1728  result->is_null = item.is_null;
1729  *is_end = false;
1730  } else {
1731  result->length = 0;
1732  result->pointer = NULL;
1733  result->is_null = true;
1734  *is_end = true;
1735 #ifndef __CUDACC__
1736  // out of range indexing is equivalent to returning NULL (SQL AT)
1737  CHECK_EQ(status, FlatBufferManager::Status::ItemUnspecifiedError);
1738 #endif
1739  }
1740  } else {
1741  // to be deprecated
1742  auto status = m.getItemOld(n, result->length, result->pointer, result->is_null);
1743  if (status == FlatBufferManager::Status::IndexError) {
1744  *is_end = true;
1745  result->length = 0;
1746  result->pointer = NULL;
1747  result->is_null = true;
1748  } else {
1749  *is_end = false;
1750 #ifndef __CUDACC__
1751  CHECK_EQ(status, FlatBufferManager::Status::Success);
1752 #endif
1753  }
1754  }
1755 }
#define CHECK_EQ(x, y)
Definition: Logger.h:301
constexpr double n
Definition: Utm.h:38

+ Here is the caller graph for this function:

DEVICE void VarlenArray_get_nth ( int8_t *  buf,
int  n,
bool  uncompress,
VarlenDatum result,
bool *  is_end 
)
inline

Definition at line 1757 of file sqltypes.h.

References CHECK, CHECK_EQ, VarlenDatum::is_null, VarlenDatum::length, and VarlenDatum::pointer.

1761  {
1762  FlatBufferManager m{buf};
1763  FlatBufferManager::Status status{};
1764 #ifndef __CUDACC__
1765  CHECK(m.isNestedArray());
1766 #endif
1768  status = m.getItem(n, item);
1769  if (status == FlatBufferManager::Status::Success) {
1770  result->length = item.nof_values * m.getValueSize();
1771  result->pointer = item.values;
1772  result->is_null = item.is_null;
1773  *is_end = false;
1774 #ifndef __CUDACC__
1775  CHECK(!uncompress); // NOT IMPLEMENTED
1776 #endif
1777  } else {
1778  result->length = 0;
1779  result->pointer = NULL;
1780  result->is_null = true;
1781  *is_end = true;
1782 #ifndef __CUDACC__
1783  // out of range indexing is equivalent to returning NULL (SQL AT)
1784  CHECK_EQ(status, FlatBufferManager::Status::IndexError);
1785 #endif
1786  }
1787 }
#define CHECK_EQ(x, y)
Definition: Logger.h:301
bool is_null
Definition: Datum.h:59
int8_t * pointer
Definition: Datum.h:58
#define CHECK(condition)
Definition: Logger.h:291
constexpr double n
Definition: Utm.h:38
size_t length
Definition: Datum.h:57