OmniSciDB  fe05a0c208
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
InlineNullValues.h File Reference
#include "../Logger/Logger.h"
#include "funcannotations.h"
#include <cfloat>
#include <cstdint>
#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 >
inline_fp_null_array_value ()
 
template<>
constexpr float inline_fp_null_array_value< float > ()
 
template<>
constexpr 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 , bool array = false>
CONSTEXPR DEVICE void set_null (T &value)
 

Macro Definition Documentation

#define CONSTEXPR   constexpr

Definition at line 46 of file InlineNullValues.h.

Referenced by serialized_null_value().

#define NULL_ARRAY_BIGINT   (INT64_MIN + 1)
#define NULL_ARRAY_BOOLEAN   (INT8_MIN + 1)

Definition at line 35 of file InlineNullValues.h.

Referenced by FixedLengthArrayNoneEncoder::is_null().

#define NULL_ARRAY_COMPRESSED_32   0x80000000U

Definition at line 43 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 33 of file InlineNullValues.h.

Referenced by import_export::TypedImportBuffer::add_value(), import_export::TypedImportBuffer::add_values(), Parser::InsertValuesStmt::analyze(), ResultSet::calculateQuantile(), CodeGenerator::codegenDiv(), CodeGenerator::codegenFpArith(), CodeGenerator::codegenIsNullNumber(), Geospatial::compress_null_point(), GeoPointValueConverter::convertToColumnarFormat(), GeoLinestringValueConverter::convertToColumnarFormat(), GeoPolygonValueConverter::convertToColumnarFormat(), GeoMultiPolygonValueConverter::convertToColumnarFormat(), import_export::QueryExporterCSV::exportResults(), float_to_double_bin(), Geospatial::GeoPoint::getColumns(), Geospatial::GeoLineString::getColumns(), Geospatial::GeoPolygon::getColumns(), Geospatial::GeoMultiPolygon::getColumns(), Geospatial::GeoTypesFactory::getNullGeoColumns(), 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::isNull(), ResultSet::makeTargetValue(), ResultSet::ResultSetComparator< BUFFER_ITERATOR_TYPE >::materializeApproxMedianColumn(), import_export::NullDatum(), ResultSet::ResultSetComparator< BUFFER_ITERATOR_TYPE >::operator()(), 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 244 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 import_export::NullArrayDatum(), and foreign_storage::ParquetFixedLengthArrayEncoder::setNullFixedLengthArraySentinel().

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

+ 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 148 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(), Parser::InsertValuesStmt::determineLeafIndex(), RelAlgExecutor::executeSimpleInsert(), PerfectJoinHashTable::fetchColumnsForDevice(), BaselineJoinHashTable::fetchColumnsForDevice(), anonymous_namespace{ColumnarResults.cpp}::fixed_encoding_nullable_val(), PerfectJoinHashTable::getHashJoinArgs(), PerfectJoinHashTableBuilder::initOneToManyHashTableOnCpu(), PerfectJoinHashTableBuilder::initOneToOneHashTableOnCpu(), anonymous_namespace{RelAlgExecutor.cpp}::insert_one_dict_str(), anonymous_namespace{WindowContext.cpp}::integer_comparator(), result_set::lazy_decode(), import_export::NullDatum(), anonymous_namespace{ArrowImporter.h}::ArrowValue< void * >::operator DATA_TYPE(), anonymous_namespace{ArrowImporter.h}::ArrowValue< std::string >::operator DATA_TYPE(), QueryRewriter::rewriteColumnarUpdate(), and import_export::TDatumToDatum().

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

Definition at line 92 of file InlineNullValues.h.

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

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

Definition at line 107 of file InlineNullValues.h.

References NULL_ARRAY_DOUBLE.

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

107  {
108  return NULL_ARRAY_DOUBLE;
109 }
#define NULL_ARRAY_DOUBLE

+ Here is the caller graph for this function:

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

Definition at line 102 of file InlineNullValues.h.

References NULL_ARRAY_FLOAT.

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

102  {
103  return NULL_ARRAY_FLOAT;
104 }
#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 192 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 GroupByAndAggregate::codegenOutputSlot(), 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(), pair_to_double(), synthesize_metadata(), and import_export::anonymous_namespace{QueryExporterCSV.cpp}::target_value_to_string().

192  {
193  CHECK(ti.is_fp());
194  const auto type = ti.get_type();
195  switch (type) {
196  case kFLOAT:
198  case kDOUBLE:
200  default:
201  abort();
202  }
203 }
constexpr float inline_fp_null_value< float >()
constexpr double inline_fp_null_value< double >()
#define CHECK(condition)
Definition: Logger.h:203

+ 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 72 of file InlineNullValues.h.

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

72  {
73 #if !(defined(__CUDACC__) || defined(NO_BOOST))
74  LOG(FATAL) << "Only float or double overloads should be called.";
75 #else
76  LOG(FATAL);
77 #endif
78  return T{};
79 }
#define LOG(tag)
Definition: Logger.h:194
template<>
constexpr double inline_fp_null_value< double > ( )
inline

Definition at line 87 of file InlineNullValues.h.

References NULL_DOUBLE.

Referenced by NumericConverterFactory< SOURCE_TYPE, TARGET_TYPE >::create(), anonymous_namespace{TypedDataAccessors.h}::get_scalar(), inline_fp_null_val(), anonymous_namespace{TypedDataAccessors.h}::put_null(), SqliteMemDatabase::runSelect(), and anonymous_namespace{ExternalExecutor.cpp}::vt_column().

87  {
88  return NULL_DOUBLE;
89 }
#define NULL_DOUBLE

+ Here is the caller graph for this function:

template<>
constexpr float inline_fp_null_value< float > ( )
inline

Definition at line 82 of file InlineNullValues.h.

References NULL_FLOAT.

Referenced by NumericConverterFactory< SOURCE_TYPE, TARGET_TYPE >::create(), anonymous_namespace{TypedDataAccessors.h}::get_scalar(), inline_fp_null_val(), anonymous_namespace{TypedDataAccessors.h}::put_null(), SqliteMemDatabase::runSelect(), and anonymous_namespace{ExternalExecutor.cpp}::vt_column().

82  {
83  return NULL_FLOAT;
84 }
#define NULL_FLOAT

+ Here is the caller graph for this function:

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

Definition at line 207 of file InlineNullValues.h.

References CHECK_EQ, kBIGINT, kBOOLEAN, kDATE, kDECIMAL, kENCODING_DICT, 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().

207  {
208  auto type = ti.get_type();
209  if (ti.is_string()) {
210  CHECK_EQ(kENCODING_DICT, ti.get_compression());
211  CHECK_EQ(4, ti.get_logical_size());
212  type = kINT;
213  } else {
214  CHECK_EQ(kENCODING_NONE, ti.get_compression());
215  }
216  // For all of the types below NULL sentinel is min of the range,
217  // the value right above it is the NULL_ARRAY sentinel
218  switch (type) {
219  case kBOOLEAN:
220  return inline_int_null_array_value<int8_t>();
221  case kTINYINT:
222  return inline_int_null_array_value<int8_t>();
223  case kSMALLINT:
224  return inline_int_null_array_value<int16_t>();
225  case kINT:
226  return inline_int_null_array_value<int32_t>();
227  case kBIGINT:
228  return inline_int_null_array_value<int64_t>();
229  case kTIMESTAMP:
230  case kTIME:
231  case kDATE:
232  case kINTERVAL_DAY_TIME:
234  return inline_int_null_array_value<int64_t>();
235  case kDECIMAL:
236  case kNUMERIC:
237  return inline_int_null_array_value<int64_t>();
238  default:
239  abort();
240  }
241 }
#define CHECK_EQ(x, y)
Definition: Logger.h:211
Definition: sqltypes.h:48
Definition: sqltypes.h:52
Definition: sqltypes.h:44

+ Here is the caller graph for this function:

template<class T >
constexpr int64_t inline_int_null_array_value ( )
inline

Definition at line 58 of file InlineNullValues.h.

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

Definition at line 113 of file InlineNullValues.h.

References CHECK_EQ, kBIGINT, kBOOLEAN, kDATE, kDECIMAL, kENCODING_DICT, 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::codegenDiv(), CodeGenerator::codegenMod(), CodeGenerator::codegenMul(), GroupByAndAggregate::codegenOutputSlot(), CodeGenerator::codegenSub(), 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(), getExpressionRange(), RelAlgTranslator::getInIntegerSetExpr(), CgenState::getOrAddLiteral(), inline_fixed_encoding_null_val(), anonymous_namespace{Execute.cpp}::inline_null_val(), CgenState::inlineIntNull(), result_set::lazy_decode(), ResultSet::makeTargetValue(), null_val_bit_pattern(), pair_to_double(), SqliteMemDatabase::runSelect(), synthesize_metadata(), and import_export::anonymous_namespace{QueryExporterCSV.cpp}::target_value_to_string().

113  {
114  auto type = ti.get_type();
115  if (ti.is_string()) {
116  CHECK_EQ(kENCODING_DICT, ti.get_compression());
117  CHECK_EQ(4, ti.get_logical_size());
118  type = kINT;
119  } else {
120  CHECK_EQ(kENCODING_NONE, ti.get_compression());
121  }
122  switch (type) {
123  case kBOOLEAN:
124  return inline_int_null_value<int8_t>();
125  case kTINYINT:
126  return inline_int_null_value<int8_t>();
127  case kSMALLINT:
128  return inline_int_null_value<int16_t>();
129  case kINT:
130  return inline_int_null_value<int32_t>();
131  case kBIGINT:
132  return inline_int_null_value<int64_t>();
133  case kTIMESTAMP:
134  case kTIME:
135  case kDATE:
136  case kINTERVAL_DAY_TIME:
138  return inline_int_null_value<int64_t>();
139  case kDECIMAL:
140  case kNUMERIC:
141  return inline_int_null_value<int64_t>();
142  default:
143  abort();
144  }
145 }
#define CHECK_EQ(x, y)
Definition: Logger.h:211
Definition: sqltypes.h:48
Definition: sqltypes.h:52
Definition: sqltypes.h:44

+ Here is the caller graph for this function:

template<class T >
constexpr int64_t inline_int_null_value ( )
inline

Definition at line 52 of file InlineNullValues.h.

52  {
53  return std::is_signed<T>::value ? std::numeric_limits<T>::min()
54  : std::numeric_limits<T>::max();
55 }
template<typename T , bool array = false>
CONSTEXPR DEVICE bool is_null ( const T &  value)
inline

Definition at line 356 of file InlineNullValues.h.

Referenced by Parser::InsertValuesStmt::analyze(), ArrayNoneEncoder::appendData(), ChunkIter_get_nth(), ChunkIter_get_nth_point_coords(), CodeGenerator::codegenGeoOperator(), Fragmenter_Namespace::FixedLenArrayChunkConverter::convertToColumnarFormat(), ArrayValueConverter< ELEMENT_CONVERTER >::convertToColumnarFormat(), RelAlgExecutor::executeSimpleInsert(), import_export::QueryExporterCSV::exportResults(), anonymous_namespace{ResultSetIteration.cpp}::GeoQueryOutputFetchHandler::fetch(), 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(), foreign_storage::csv_file_buffer_parser::is_null_datum(), Column< T >::isNull(), DBHandler::load_table(), foreign_storage::csv_file_buffer_parser::parse_buffer(), NumericValueConverter< int64_t, TARGET_TYPE >::processArrayBuffer(), DictionaryValueConverter< TARGET_TYPE >::processArrayBuffer(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), SqliteConnector::query_with_text_params(), Fragmenter_Namespace::set_chunk_stats(), ArrowForeignStorageBase::setNullValues(), import_export::StringToArray(), RelAlgTranslator::translateCurrentDate(), RelAlgTranslator::translateCurrentTime(), RelAlgTranslator::translateUoper(), and DBHandler::value_to_thrift_column().

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

+ Here is the caller graph for this function:

template<class T >
constexpr int64_t max_valid_int_value ( )
inline

Definition at line 66 of file InlineNullValues.h.

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

Definition at line 327 of file InlineNullValues.h.

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

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

Definition at line 362 of file InlineNullValues.h.

Referenced by Column< T >::setNull().

362  {
363  using TT = typename serialize_detail::IntType<sizeof(T)>::type;
364  *(TT*)(&value) = serialized_null_value<T, array>();
365 }

+ Here is the caller graph for this function: