OmniSciDB  ca0c39ec8f
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
InlineNullValues.h File Reference
#include "../Logger/Logger.h"
#include "funcannotations.h"
#include <cassert>
#include <cfloat>
#include <cstdint>
#include <cstdlib>
#include <limits>
#include <type_traits>
+ Include dependency graph for InlineNullValues.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  serialize_detail::IntType< overload >
 
struct  serialize_detail::IntType< 1 >
 
struct  serialize_detail::IntType< 2 >
 
struct  serialize_detail::IntType< 4 >
 
struct  serialize_detail::IntType< 8 >
 

Namespaces

 serialize_detail
 

Macros

#define NULL_BOOLEAN   INT8_MIN
 
#define NULL_TINYINT   INT8_MIN
 
#define NULL_SMALLINT   INT16_MIN
 
#define NULL_INT   INT32_MIN
 
#define NULL_BIGINT   INT64_MIN
 
#define NULL_FLOAT   FLT_MIN
 
#define NULL_DOUBLE   DBL_MIN
 
#define NULL_ARRAY_BOOLEAN   (INT8_MIN + 1)
 
#define NULL_ARRAY_TINYINT   (INT8_MIN + 1)
 
#define NULL_ARRAY_SMALLINT   (INT16_MIN + 1)
 
#define NULL_ARRAY_INT   (INT32_MIN + 1)
 
#define NULL_ARRAY_BIGINT   (INT64_MIN + 1)
 
#define NULL_ARRAY_FLOAT   (FLT_MIN * 2.0)
 
#define NULL_ARRAY_DOUBLE   (DBL_MIN * 2.0)
 
#define NULL_ARRAY_COMPRESSED_32   0x80000000U
 
#define CONSTEXPR   constexpr
 

Functions

template<class T >
constexpr int64_t inline_int_null_value ()
 
template<class T >
constexpr int64_t inline_int_null_array_value ()
 
template<class T >
constexpr int64_t max_valid_int_value ()
 
template<typename T >
constexpr T inline_fp_null_value ()
 
template<>
constexpr float inline_fp_null_value< float > ()
 
template<>
constexpr double inline_fp_null_value< double > ()
 
template<typename T >
DEVICEinline_fp_null_array_value ()
 
template<>
DEVICE float inline_fp_null_array_value< float > ()
 
template<>
DEVICE double inline_fp_null_array_value< double > ()
 
template<typename SQL_TYPE_INFO >
int64_t inline_int_null_val (const SQL_TYPE_INFO &ti)
 
template<typename SQL_TYPE_INFO >
int64_t inline_fixed_encoding_null_val (const SQL_TYPE_INFO &ti)
 
template<typename SQL_TYPE_INFO >
double inline_fp_null_val (const SQL_TYPE_INFO &ti)
 
template<typename SQL_TYPE_INFO >
int64_t inline_int_null_array_val (const SQL_TYPE_INFO &ti)
 
template<typename SQL_TYPE_INFO >
int64_t inline_fixed_encoding_null_array_val (const SQL_TYPE_INFO &ti)
 
template<typename T , bool array = false>
CONSTEXPR DEVICE
serialize_detail::IntType
< sizeof(T)>::type 
serialized_null_value ()
 
template<typename T , bool array = false>
CONSTEXPR DEVICE bool is_null (const T &value)
 
template<typename T >
CONSTEXPR DEVICEinline_null_value ()
 
template<typename T , bool array = false>
CONSTEXPR DEVICE void set_null (T &value)
 

Macro Definition Documentation

#define CONSTEXPR   constexpr

Definition at line 48 of file InlineNullValues.h.

Referenced by inline_null_value(), and serialized_null_value().

#define NULL_ARRAY_BIGINT   (INT64_MIN + 1)
#define NULL_ARRAY_BOOLEAN   (INT8_MIN + 1)
#define NULL_ARRAY_COMPRESSED_32   0x80000000U

Definition at line 45 of file InlineNullValues.h.

Referenced by SQLTypeInfo::is_null_point_coord_array().

#define NULL_ARRAY_INT   (INT32_MIN + 1)
#define NULL_ARRAY_SMALLINT   (INT16_MIN + 1)
#define NULL_ARRAY_TINYINT   (INT8_MIN + 1)
#define NULL_DOUBLE   DBL_MIN

Definition at line 35 of file InlineNullValues.h.

Referenced by import_export::TypedImportBuffer::add_value(), import_export::TypedImportBuffer::add_values(), import_export::TypedImportBuffer::addDefaultValues(), Parser::InsertValuesStmt::analyze(), ResultSet::calculateQuantile(), CodeGenerator::codegenConstantWidthBucketExpr(), CodeGenerator::codegenDiv(), CodeGenerator::codegenFpArith(), CodeGenerator::codegenIsNullNumber(), import_export::ImporterUtils::composeNullPointCoords(), Geospatial::compress_null_point(), GeoPointValueConverter::convertToColumnarFormat(), GeoMultiPointValueConverter::convertToColumnarFormat(), GeoLinestringValueConverter::convertToColumnarFormat(), GeoMultiLinestringValueConverter::convertToColumnarFormat(), GeoPolygonValueConverter::convertToColumnarFormat(), GeoMultiPolygonValueConverter::convertToColumnarFormat(), import_export::QueryExporterCSV::exportResults(), float_to_double_bin(), Geospatial::GeoPoint::getColumns(), Geospatial::GeoMultiPoint::getColumns(), Geospatial::GeoLineString::getColumns(), Geospatial::GeoMultiLineString::getColumns(), Geospatial::GeoPolygon::getColumns(), Geospatial::GeoMultiPolygon::getColumns(), Geospatial::GeoTypesFactory::getNullGeoColumns(), import_export::Importer::importGDALRaster(), inline_fp_null_value< double >(), CgenState::inlineFpNull(), import_export::anonymous_namespace{QueryExporterGDAL.cpp}::insert_array_column(), import_export::anonymous_namespace{QueryExporterGDAL.cpp}::insert_scalar_column(), SQLTypeInfo::is_null(), Analyzer::anonymous_namespace{Analyzer.cpp}::is_null_value(), ResultSet::makeTargetValue(), ResultSet::ResultSetComparator< BUFFER_ITERATOR_TYPE >::materializeApproxQuantileColumn(), NullDatum(), ResultSet::ResultSetComparator< BUFFER_ITERATOR_TYPE >::operator()(), pair_to_double(), import_export::Importer::set_geo_physical_import_buffer(), import_export::Importer::set_geo_physical_import_buffer_columnar(), Analyzer::Constant::set_null_value(), import_export::TDatumToDatum(), FixedLengthArrayNoneEncoder::update_elem_stats(), ArrayNoneEncoder::update_elem_stats(), DBHandler::value_to_thrift(), and DBHandler::value_to_thrift_column().

Function Documentation

template<typename SQL_TYPE_INFO >
int64_t inline_fixed_encoding_null_array_val ( const SQL_TYPE_INFO &  ti)
inline

Definition at line 252 of file InlineNullValues.h.

References CHECK, CHECK_EQ, inline_int_null_array_val(), kENCODING_DATE_IN_DAYS, kENCODING_DICT, kENCODING_FIXED, and kENCODING_NONE.

Referenced by inline_int_null_array_val(), import_export::NullArrayDatum(), and foreign_storage::ParquetFixedLengthArrayEncoder::setNullFixedLengthArraySentinel().

252  {
253  if (ti.get_compression() == kENCODING_NONE) {
254  return inline_int_null_array_val(ti);
255  }
256  if (ti.get_compression() == kENCODING_DATE_IN_DAYS) {
257  switch (ti.get_comp_param()) {
258  case 0:
259  case 32:
260  return inline_int_null_array_value<int32_t>();
261  case 16:
262  return inline_int_null_array_value<int16_t>();
263  default:
264 #ifndef __CUDACC__
265  CHECK(false) << "Unknown encoding width for date in days: "
266  << ti.get_comp_param();
267 #else
268  CHECK(false);
269 #endif
270  }
271  }
272  if (ti.get_compression() == kENCODING_DICT) {
273  CHECK(ti.is_string());
274  switch (ti.get_size()) {
275  case 1:
276  return inline_int_null_array_value<uint8_t>();
277  case 2:
278  return inline_int_null_array_value<uint16_t>();
279  case 4:
280  return inline_int_null_array_value<int32_t>();
281  default:
282 #ifndef __CUDACC__
283  CHECK(false) << "Unknown size for dictionary encoded type: " << ti.get_size();
284 #else
285  CHECK(false);
286 #endif
287  }
288  }
289 #ifndef __CUDACC__
290  CHECK(false) << "Currently don't support fixed length arrays with fixed encoding";
291 #else
292  CHECK(false);
293 #endif
294  CHECK_EQ(kENCODING_FIXED, ti.get_compression());
295  CHECK(ti.is_integer() || ti.is_time() || ti.is_decimal());
296  CHECK_EQ(0, ti.get_comp_param() % 8);
297  // The value of the NULL sentinel for fixed encoding is:
298  // -(1LL << (ti.get_comp_param() - 1))
299  // NULL_ARRAY sentinel would have to be the value just above NULL:
300  return -(1LL << (ti.get_comp_param() - 1)) + 1;
301 }
#define CHECK_EQ(x, y)
Definition: Logger.h:230
int64_t inline_int_null_array_val(const SQL_TYPE_INFO &ti)
#define CHECK(condition)
Definition: Logger.h:222

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename SQL_TYPE_INFO >
int64_t inline_fixed_encoding_null_val ( const SQL_TYPE_INFO &  ti)
inline

Definition at line 153 of file InlineNullValues.h.

References CHECK, CHECK_EQ, inline_int_null_val(), kENCODING_DATE_IN_DAYS, kENCODING_DICT, kENCODING_FIXED, and kENCODING_NONE.

Referenced by import_export::TypedImportBuffer::add_value(), import_export::TypedImportBuffer::add_values(), import_export::TypedImportBuffer::addDefaultValues(), RelAlgExecutor::executeSimpleInsert(), PerfectJoinHashTable::fetchColumnsForDevice(), BaselineJoinHashTable::fetchColumnsForDevice(), anonymous_namespace{ColumnarResults.cpp}::fixed_encoding_nullable_val(), anonymous_namespace{WindowFunctionIR.cpp}::get_null_value_by_size_with_encoding(), PerfectJoinHashTable::getHashJoinArgs(), ResultSet::getUniqueStringsForDictEncodedTargetCol(), PerfectJoinHashTableBuilder::initOneToManyHashTableOnCpu(), PerfectJoinHashTableBuilder::initOneToOneHashTableOnCpu(), inline_int_null_val(), CgenState::inlineIntNull(), anonymous_namespace{RelAlgExecutor.cpp}::insert_one_dict_str(), anonymous_namespace{WindowContext.cpp}::integer_comparator(), result_set::lazy_decode(), NullDatum(), anonymous_namespace{ArrowImporter.h}::ArrowValue< void * >::operator DATA_TYPE(), anonymous_namespace{ArrowImporter.h}::ArrowValue< std::string >::operator DATA_TYPE(), QueryRewriter::rewriteColumnarUpdate(), synthesize_metadata_table_function(), and import_export::TDatumToDatum().

153  {
154  if (ti.get_compression() == kENCODING_NONE) {
155  return inline_int_null_val(ti);
156  }
157  if (ti.get_compression() == kENCODING_DATE_IN_DAYS) {
158  switch (ti.get_comp_param()) {
159  case 0:
160  case 32:
161  return inline_int_null_value<int32_t>();
162  case 16:
163  return inline_int_null_value<int16_t>();
164  default:
165 #ifndef __CUDACC__
166  CHECK(false) << "Unknown encoding width for date in days: "
167  << ti.get_comp_param();
168 #else
169  CHECK(false);
170 #endif
171  }
172  }
173  if (ti.get_compression() == kENCODING_DICT) {
174  CHECK(ti.is_string());
175  switch (ti.get_size()) {
176  case 1:
177  return inline_int_null_value<uint8_t>();
178  case 2:
179  return inline_int_null_value<uint16_t>();
180  case 4:
181  return inline_int_null_value<int32_t>();
182  default:
183 #ifndef __CUDACC__
184  CHECK(false) << "Unknown size for dictionary encoded type: " << ti.get_size();
185 #else
186  CHECK(false);
187 #endif
188  }
189  }
190  CHECK_EQ(kENCODING_FIXED, ti.get_compression());
191  CHECK(ti.is_integer() || ti.is_time() || ti.is_decimal());
192  CHECK_EQ(0, ti.get_comp_param() % 8);
193  return -(1LL << (ti.get_comp_param() - 1));
194 }
#define CHECK_EQ(x, y)
Definition: Logger.h:230
#define CHECK(condition)
Definition: Logger.h:222
int64_t inline_int_null_val(const SQL_TYPE_INFO &ti)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
DEVICE T inline_fp_null_array_value ( )

Definition at line 94 of file InlineNullValues.h.

References logger::FATAL, LOG, and heavydb.dtypes::T.

94  {
95 #if !(defined(__CUDACC__) || defined(NO_BOOST))
96  LOG(FATAL) << "Only float or double overloads should be called.";
97 #else
98  assert(false);
99 #endif
100  return T{};
101 }
#define LOG(tag)
Definition: Logger.h:216
template<>
DEVICE double inline_fp_null_array_value< double > ( )
inline

Definition at line 109 of file InlineNullValues.h.

References NULL_ARRAY_DOUBLE.

Referenced by anonymous_namespace{TypedDataAccessors.h}::put_null_array().

109  {
110  return NULL_ARRAY_DOUBLE;
111 }
#define NULL_ARRAY_DOUBLE

+ Here is the caller graph for this function:

template<>
DEVICE float inline_fp_null_array_value< float > ( )
inline

Definition at line 104 of file InlineNullValues.h.

References NULL_ARRAY_FLOAT.

Referenced by anonymous_namespace{TypedDataAccessors.h}::put_null_array().

104  {
105  return NULL_ARRAY_FLOAT;
106 }
#define NULL_ARRAY_FLOAT

+ Here is the caller graph for this function:

template<typename SQL_TYPE_INFO >
double inline_fp_null_val ( const SQL_TYPE_INFO &  ti)
inline

Definition at line 197 of file InlineNullValues.h.

References CHECK, inline_fp_null_value< double >(), inline_fp_null_value< float >(), kDOUBLE, kFLOAT, and run_benchmark_import::type.

Referenced by CodeGenerator::codegenConstantWidthBucketExpr(), spatial_type::PointConstructor::codegenLoads(), GroupByAndAggregate::codegenOutputSlot(), Analyzer::WidthBucketExpr::compute_bucket(), anonymous_namespace{ArrowResultSetConverter.cpp}::create_or_append_validity(), anonymous_namespace{RelAlgTranslator.cpp}::datum_from_scalar_tv(), get_agg_initial_val(), anonymous_namespace{TypedDataAccessors.h}::NullSentinelSupplier::get_null_sentinel_for_type(), CgenState::getOrAddLiteral(), anonymous_namespace{Execute.cpp}::inline_null_val(), null_val_bit_pattern(), anonymous_namespace{ArrowImporter.h}::ArrowValue< void * >::operator DATA_TYPE(), synthesize_metadata(), and import_export::anonymous_namespace{QueryExporterCSV.cpp}::target_value_to_string().

197  {
198  CHECK(ti.is_fp());
199  const auto type = ti.get_type();
200  switch (type) {
201  case kFLOAT:
203  case kDOUBLE:
205  default:
206  abort();
207  }
208 }
constexpr float inline_fp_null_value< float >()
constexpr double inline_fp_null_value< double >()
#define CHECK(condition)
Definition: Logger.h:222

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
constexpr T inline_fp_null_value ( )
inline

Definition at line 74 of file InlineNullValues.h.

References logger::FATAL, LOG, and heavydb.dtypes::T.

74  {
75 #if !(defined(__CUDACC__) || defined(NO_BOOST))
76  LOG(FATAL) << "Only float or double overloads should be called.";
77 #else
78  assert(false);
79 #endif
80  return T{};
81 }
#define LOG(tag)
Definition: Logger.h:216
template<typename SQL_TYPE_INFO >
int64_t inline_int_null_array_val ( const SQL_TYPE_INFO &  ti)
inline

Definition at line 212 of file InlineNullValues.h.

References CHECK_EQ, inline_fixed_encoding_null_array_val(), kBIGINT, kBOOLEAN, kDATE, kDECIMAL, kENCODING_DICT, kENCODING_FIXED, kENCODING_NONE, kINT, kINTERVAL_DAY_TIME, kINTERVAL_YEAR_MONTH, kNUMERIC, kSMALLINT, kTIME, kTIMESTAMP, kTINYINT, and run_benchmark_import::type.

Referenced by inline_fixed_encoding_null_array_val().

212  {
213  auto type = ti.get_type();
214  if (ti.is_string()) {
215  CHECK_EQ(kENCODING_DICT, ti.get_compression());
216  CHECK_EQ(4, ti.get_logical_size());
217  type = kINT;
218  } else {
219  CHECK_EQ(kENCODING_NONE, ti.get_compression());
220  }
221  // For all of the types below NULL sentinel is min of the range,
222  // the value right above it is the NULL_ARRAY sentinel
223  switch (type) {
224  case kBOOLEAN:
225  return inline_int_null_array_value<int8_t>();
226  case kTINYINT:
227  return inline_int_null_array_value<int8_t>();
228  case kSMALLINT:
229  return inline_int_null_array_value<int16_t>();
230  case kINT:
231  return inline_int_null_array_value<int32_t>();
232  case kBIGINT:
233  return inline_int_null_array_value<int64_t>();
234  case kTIMESTAMP:
235  case kTIME:
236  if (ti.get_compression() == kENCODING_FIXED) {
238  }
239  case kDATE:
240  case kINTERVAL_DAY_TIME:
242  return inline_int_null_array_value<int64_t>();
243  case kDECIMAL:
244  case kNUMERIC:
245  return inline_int_null_array_value<int64_t>();
246  default:
247  abort();
248  }
249 }
#define CHECK_EQ(x, y)
Definition: Logger.h:230
Definition: sqltypes.h:64
Definition: sqltypes.h:68
int64_t inline_fixed_encoding_null_array_val(const SQL_TYPE_INFO &ti)
Definition: sqltypes.h:60

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class T >
constexpr int64_t inline_int_null_array_value ( )
inline

Definition at line 60 of file InlineNullValues.h.

60  {
61  return std::is_signed<T>::value ? std::numeric_limits<T>::min() + 1
62  : std::numeric_limits<T>::max() - 1;
63  // TODO: null_array values in signed types would step on max valid value
64  // in fixlen unsigned arrays, the max valid value may need to be lowered.
65 }
template<typename SQL_TYPE_INFO >
int64_t inline_int_null_val ( const SQL_TYPE_INFO &  ti)
inline

Definition at line 115 of file InlineNullValues.h.

References CHECK_EQ, inline_fixed_encoding_null_val(), kBIGINT, kBOOLEAN, kDATE, kDECIMAL, kENCODING_DICT, kENCODING_FIXED, kENCODING_NONE, kINT, kINTERVAL_DAY_TIME, kINTERVAL_YEAR_MONTH, kNUMERIC, kSMALLINT, kTIME, kTIMESTAMP, kTINYINT, and run_benchmark_import::type.

Referenced by ResultSetLogicalValuesBuilder::build(), InValuesBitmap::codegen(), CodeGenerator::codegen(), CodeGenerator::codegenAdd(), CodeGenerator::codegenBinOpWithOverflowForCPU(), CodeGenerator::codegenCastBetweenIntTypes(), CodeGenerator::codegenCastBetweenIntTypesOverflowChecks(), CodeGenerator::codegenConstantWidthBucketExpr(), CodeGenerator::codegenDiv(), spatial_type::PointConstructor::codegenLoads(), CodeGenerator::codegenMod(), CodeGenerator::codegenMul(), GroupByAndAggregate::codegenOutputSlot(), CodeGenerator::codegenSub(), Analyzer::WidthBucketExpr::compute_bucket(), anonymous_namespace{ArrowResultSetConverter.cpp}::create_or_append_validity(), CodeGenerator::createInValuesBitmap(), anonymous_namespace{RelAlgTranslator.cpp}::datum_from_scalar_tv(), anonymous_namespace{ColumnarResults.cpp}::fixed_encoding_nullable_val(), get_agg_initial_val(), anonymous_namespace{TypedDataAccessors.h}::NullSentinelSupplier::get_null_sentinel_for_type(), anonymous_namespace{WindowFunctionIR.cpp}::get_null_value_by_size(), anonymous_namespace{WindowFunctionIR.cpp}::get_null_value_by_size_with_encoding(), getExpressionRange(), RelAlgTranslator::getInIntegerSetExpr(), spatial_type::PointConstructor::getNullCheckCodegen(), CgenState::getOrAddLiteral(), ArrowResultSet::getRowAt(), inline_fixed_encoding_null_val(), anonymous_namespace{Execute.cpp}::inline_null_val(), CgenState::inlineIntNull(), result_set::lazy_decode(), ResultSet::makeTargetValue(), null_val_bit_pattern(), SqliteMemDatabase::runSelect(), synthesize_metadata(), import_export::anonymous_namespace{QueryExporterCSV.cpp}::target_value_to_string(), and ResultSet::translateDictEncodedColumns().

115  {
116  auto type = ti.get_type();
117  if (ti.is_string()) {
118  CHECK_EQ(kENCODING_DICT, ti.get_compression());
119  CHECK_EQ(4, ti.get_logical_size());
120  type = kINT;
121  } else {
122  CHECK_EQ(kENCODING_NONE, ti.get_compression());
123  }
124  switch (type) {
125  case kBOOLEAN:
126  return inline_int_null_value<int8_t>();
127  case kTINYINT:
128  return inline_int_null_value<int8_t>();
129  case kSMALLINT:
130  return inline_int_null_value<int16_t>();
131  case kINT:
132  return inline_int_null_value<int32_t>();
133  case kBIGINT:
134  return inline_int_null_value<int64_t>();
135  case kTIMESTAMP:
136  case kTIME:
137  if (ti.get_compression() == kENCODING_FIXED) {
139  }
140  case kDATE:
141  case kINTERVAL_DAY_TIME:
143  return inline_int_null_value<int64_t>();
144  case kDECIMAL:
145  case kNUMERIC:
146  return inline_int_null_value<int64_t>();
147  default:
148  abort();
149  }
150 }
#define CHECK_EQ(x, y)
Definition: Logger.h:230
Definition: sqltypes.h:64
Definition: sqltypes.h:68
int64_t inline_fixed_encoding_null_val(const SQL_TYPE_INFO &ti)
Definition: sqltypes.h:60

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class T >
constexpr int64_t inline_int_null_value ( )
inline

Definition at line 54 of file InlineNullValues.h.

54  {
55  return std::is_signed<T>::value ? std::numeric_limits<T>::min()
56  : std::numeric_limits<T>::max();
57 }
template<typename T >
CONSTEXPR DEVICE T inline_null_value ( )
inline

Definition at line 365 of file InlineNullValues.h.

References CHECK, and CONSTEXPR.

365  {
366  if
367  CONSTEXPR(std::is_floating_point<T>::value) { return inline_fp_null_value<T>(); }
368  else if
369  CONSTEXPR(std::is_integral<T>::value) { return inline_int_null_value<T>(); }
370 #if !(defined(__CUDACC__) || defined(NO_BOOST))
371  else {
372  CHECK(false) << "Serializing null values of floating point or integral types only is "
373  "supported.";
374  }
375 #endif
376  return inline_int_null_value<int32_t>(); // dummy return
377 }
#define CONSTEXPR
#define CHECK(condition)
Definition: Logger.h:222
template<typename T , bool array = false>
CONSTEXPR DEVICE bool is_null ( const T &  value)
inline

Definition at line 359 of file InlineNullValues.h.

Referenced by import_export::TypedImportBuffer::addDefaultValues(), Parser::InsertValuesStmt::analyze(), ArrayNoneEncoder::appendData(), ChunkIter_get_nth(), ChunkIter_get_nth_point_coords(), spatial_type::Distance::codegenLoads(), spatial_type::PointAccessors::codegenLoads(), spatial_type::Transform::codegenLoads(), spatial_type::PointConstructor::codegenLoads(), convertBoolBitmapBufferWithNulls(), Fragmenter_Namespace::FixedLenArrayChunkConverter::convertToColumnarFormat(), ArrayValueConverter< ELEMENT_CONVERTER >::convertToColumnarFormat(), Parser::AddColumnStmt::execute(), RelAlgExecutor::executeSimpleInsert(), import_export::QueryExporterCSV::exportResults(), anonymous_namespace{ResultSetIteration.cpp}::GeoQueryOutputFetchHandler::fetch(), QueryRewriter::generateCaseExprForCountDistinctOnGroupByCol(), ArrayNoneEncoder::getArrayDatumAtIndex(), Column< Array< T > >::getItem(), import_export::import_thread_delimited(), import_export::anonymous_namespace{QueryExporterGDAL.cpp}::insert_array_column(), import_export::anonymous_namespace{QueryExporterGDAL.cpp}::insert_scalar_column(), anonymous_namespace{TypedDataAccessors.h}::integer_setter(), Column< T >::isNull(), Column< Array< T > >::isNull(), Column< TextEncodingDict >::isNull(), foreign_storage::TextFileBufferParser::isNullDatum(), foreign_storage::CsvFileBufferParser::parseBuffer(), foreign_storage::RegexFileBufferParser::parseBuffer(), NumericValueConverter< int64_t, TARGET_TYPE >::processArrayBuffer(), DictionaryValueConverter< TARGET_TYPE >::processArrayBuffer(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), SqliteConnector::query_with_text_params(), ArrowForeignStorageBase::replaceNullValuesImpl(), Fragmenter_Namespace::set_chunk_stats(), import_export::StringToArray(), RelAlgTranslator::translateCurrentDate(), RelAlgTranslator::translateCurrentTime(), RelAlgTranslator::translateUoper(), and DBHandler::value_to_thrift_column().

359  {
360  using TT = typename serialize_detail::IntType<sizeof(T)>::type;
361  return serialized_null_value<T, array>() == *(TT*)(&value);
362 }

+ Here is the caller graph for this function:

template<class T >
constexpr int64_t max_valid_int_value ( )
inline

Definition at line 68 of file InlineNullValues.h.

68  {
69  return std::is_signed<T>::value ? std::numeric_limits<T>::max()
70  : std::numeric_limits<T>::max() - 1;
71 }
template<typename T , bool array = false>
CONSTEXPR DEVICE serialize_detail::IntType<sizeof(T)>::type serialized_null_value ( )
inline

Definition at line 330 of file InlineNullValues.h.

References CHECK, CONSTEXPR, and heavydb.dtypes::T.

330  {
331  using TT = typename serialize_detail::IntType<sizeof(T)>::type;
332  T nv = 0;
333  if
334  CONSTEXPR(std::is_floating_point<T>::value) {
335  if
336  CONSTEXPR(array) { nv = inline_fp_null_array_value<T>(); }
337  else {
338  nv = inline_fp_null_value<T>();
339  }
340  }
341  else if
342  CONSTEXPR(std::is_integral<T>::value) {
343  if
344  CONSTEXPR(array) { nv = inline_int_null_array_value<T>(); }
345  else {
346  nv = inline_int_null_value<T>();
347  }
348  }
349 #if !(defined(__CUDACC__) || defined(NO_BOOST))
350  else {
351  CHECK(false) << "Serializing null values of floating point or integral types only is "
352  "supported.";
353  }
354 #endif
355  return *(TT*)(&nv);
356 }
#define CONSTEXPR
#define CHECK(condition)
Definition: Logger.h:222