OmniSciDB  72c90bc290
 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 get_null_value(), and 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::codegenCmp(), 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(), get_null_value(), 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::isNullIval(), ResultSet::makeTargetValue(), ResultSet::ResultSetComparator< BUFFER_ITERATOR_TYPE >::materializeApproxQuantileColumn(), NullDatum(), ResultSet::nullScalarTargetValue(), 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(), CrossSectionTableFunctions::tf_cross_section_2d_impl(), 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 249 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().

249  {
250  if (ti.get_compression() == kENCODING_NONE) {
251  return inline_int_null_array_val(ti);
252  }
253  if (ti.get_compression() == kENCODING_DATE_IN_DAYS) {
254  switch (ti.get_comp_param()) {
255  case 0:
256  case 32:
257  return inline_int_null_array_value<int32_t>();
258  case 16:
259  return inline_int_null_array_value<int16_t>();
260  default:
261 #ifndef __CUDACC__
262  CHECK(false) << "Unknown encoding width for date in days: "
263  << ti.get_comp_param();
264 #else
265  CHECK(false);
266 #endif
267  }
268  }
269  if (ti.get_compression() == kENCODING_DICT) {
270  CHECK(ti.is_string());
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:301
int64_t inline_int_null_array_val(const SQL_TYPE_INFO &ti)
#define CHECK(condition)
Definition: Logger.h:291

+ 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(), CodeGenerator::codegen(), Executor::codegenWindowFunctionAggregateCalls(), RelAlgExecutor::executeSimpleInsert(), PerfectJoinHashTable::fetchColumnsForDevice(), BaselineJoinHashTable::fetchColumnsForDevice(), anonymous_namespace{ColumnarResults.cpp}::fixed_encoding_nullable_val(), anonymous_namespace{WindowFunctionIR.cpp}::get_null_value_by_size(), anonymous_namespace{WindowFunctionIR.cpp}::get_null_value_by_size_with_encoding(), PerfectJoinHashTable::getHashJoinArgs(), ResultSet::getUniqueStringsForDictEncodedTargetCol(), PerfectJoinHashTableBuilder::initOneToManyHashTableOnCpu(), PerfectJoinHashTableBuilder::initOneToOneHashTableOnCpu(), inline_int_null_val(), anonymous_namespace{RelAlgExecutor.cpp}::insert_one_dict_str(), anonymous_namespace{WindowContext.cpp}::integer_comparator_asc(), anonymous_namespace{WindowContext.cpp}::integer_comparator_desc(), 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:301
#define CHECK(condition)
Definition: Logger.h:291
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:285
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:291

+ 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:285
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, 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().

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  case kDATE:
237  case kINTERVAL_DAY_TIME:
239  return inline_int_null_array_value<int64_t>();
240  case kDECIMAL:
241  case kNUMERIC:
242  return inline_int_null_array_value<int64_t>();
243  default:
244  abort();
245  }
246 }
#define CHECK_EQ(x, y)
Definition: Logger.h:301
Definition: sqltypes.h:76
Definition: sqltypes.h:80
Definition: sqltypes.h:72

+ 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::codegenCmp(), CodeGenerator::codegenConstantWidthBucketExpr(), 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(), 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(), ResultSet::isNullIval(), result_set::lazy_decode(), ResultSet::makeTargetValue(), null_val_bit_pattern(), ResultSet::nullScalarTargetValue(), 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:301
Definition: sqltypes.h:76
Definition: sqltypes.h:80
int64_t inline_fixed_encoding_null_val(const SQL_TYPE_INFO &ti)
Definition: sqltypes.h:72

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

References CHECK, and CONSTEXPR.

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

Definition at line 353 of file InlineNullValues.h.

Referenced by import_export::TypedImportBuffer::addDefaultValues(), Parser::InsertValuesStmt::analyze(), ArrayNoneEncoder::appendData(), Array< T >::Array(), 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(), TableFunctionExecutionContext::execute(), Parser::AddColumnStmt::execute(), RelAlgExecutor::executeSimpleInsert(), import_export::QueryExporterCSV::exportResults(), anonymous_namespace{ResultSetIteration.cpp}::GeoQueryOutputFetchHandler::fetch(), QueryRewriter::generateCaseExprForCountDistinctOnGroupByCol(), data_conversion::anonymous_namespace{StringViewSource.h}::get_materialized_string_views(), ArrayNoneEncoder::getArrayDatumAtIndex(), Column< GeoPoint >::getItem(), Geo::GeoNestedArray< Point2D >::getPoint(), flatbuffer::NestedArray< char >::getValue(), 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(), flatbuffer::Column< Geo::MultiLineString, GeoMultiLineString >::isNull(), flatbuffer::NestedArray< char >::isNull(), Column< GeoPoint >::isNull(), Column< TextEncodingDict >::isNull(), foreign_storage::TextFileBufferParser::isNullDatum(), ResultSet::makeVarlenTargetValue(), 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(), flatbuffer::TextEncodingNone::str(), import_export::StringToArray(), Geo::GeoNestedArray< Point2D >::toCoordsWorker(), RelAlgTranslator::translateCurrentDate(), RelAlgTranslator::translateCurrentTime(), RelAlgTranslator::translateUoper(), and DBHandler::value_to_thrift_column().

353  {
354  using TT = typename serialize_detail::IntType<sizeof(T)>::type;
355  return serialized_null_value<T, array>() == *(TT*)(&value);
356 }
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 327 of file InlineNullValues.h.

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

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