OmniSciDB  21ac014ffc
 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 , 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 serialized_null_value().

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

Definition at line 37 of file InlineNullValues.h.

Referenced by FixedLengthArrayNoneEncoder::is_null().

#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(), Parser::InsertValuesStmt::analyze(), ResultSet::calculateQuantile(), CodeGenerator::codegenDiv(), CodeGenerator::codegenFpArith(), CodeGenerator::codegenIsNullNumber(), import_export::ImporterUtils::composeNullPointCoords(), 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::makeTargetValue(), ResultSet::ResultSetComparator< BUFFER_ITERATOR_TYPE >::materializeApproxQuantileColumn(), import_export::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 246 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().

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

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

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

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

+ 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 omnisci.dtypes::T.

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

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

89  {
90  return NULL_DOUBLE;
91 }
#define NULL_DOUBLE

+ Here is the caller graph for this function:

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

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

84  {
85  return NULL_FLOAT;
86 }
#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 209 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().

209  {
210  auto type = ti.get_type();
211  if (ti.is_string()) {
212  CHECK_EQ(kENCODING_DICT, ti.get_compression());
213  CHECK_EQ(4, ti.get_logical_size());
214  type = kINT;
215  } else {
216  CHECK_EQ(kENCODING_NONE, ti.get_compression());
217  }
218  // For all of the types below NULL sentinel is min of the range,
219  // the value right above it is the NULL_ARRAY sentinel
220  switch (type) {
221  case kBOOLEAN:
222  return inline_int_null_array_value<int8_t>();
223  case kTINYINT:
224  return inline_int_null_array_value<int8_t>();
225  case kSMALLINT:
226  return inline_int_null_array_value<int16_t>();
227  case kINT:
228  return inline_int_null_array_value<int32_t>();
229  case kBIGINT:
230  return inline_int_null_array_value<int64_t>();
231  case kTIMESTAMP:
232  case kTIME:
233  case kDATE:
234  case kINTERVAL_DAY_TIME:
236  return inline_int_null_array_value<int64_t>();
237  case kDECIMAL:
238  case kNUMERIC:
239  return inline_int_null_array_value<int64_t>();
240  default:
241  abort();
242  }
243 }
#define CHECK_EQ(x, y)
Definition: Logger.h:214
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 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, 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(), spatial_type::PointConstructor::codegenLoads(), 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(), spatial_type::PointConstructor::getNullCheckCodegen(), 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(), SqliteMemDatabase::runSelect(), synthesize_metadata(), and import_export::anonymous_namespace{QueryExporterCSV.cpp}::target_value_to_string().

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  case kDATE:
138  case kINTERVAL_DAY_TIME:
140  return inline_int_null_value<int64_t>();
141  case kDECIMAL:
142  case kNUMERIC:
143  return inline_int_null_value<int64_t>();
144  default:
145  abort();
146  }
147 }
#define CHECK_EQ(x, y)
Definition: Logger.h:214
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 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 , bool array = false>
CONSTEXPR DEVICE bool is_null ( const T &  value)
inline

Definition at line 358 of file InlineNullValues.h.

Referenced by Parser::InsertValuesStmt::analyze(), ArrayNoneEncoder::appendData(), ChunkIter_get_nth(), ChunkIter_get_nth_point_coords(), spatial_type::PointAccessors::codegenLoads(), spatial_type::Transform::codegenLoads(), spatial_type::PointConstructor::codegenLoads(), Fragmenter_Namespace::FixedLenArrayChunkConverter::convertToColumnarFormat(), ArrayValueConverter< ELEMENT_CONVERTER >::convertToColumnarFormat(), Parser::AddColumnStmt::execute(), 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().

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

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

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

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

Definition at line 364 of file InlineNullValues.h.

Referenced by Column< T >::operator[](), and Column< T >::setNull().

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

+ Here is the caller graph for this function: