OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
anonymous_namespace{WindowContext.cpp}::FindNullRange Struct Reference

Public Member Functions

template<typename T >
IndexPair find_null_range_int (int8_t const *order_col_buf) const
 
template<typename COL_TYPE , typename NULL_TYPE = std::conditional_t<sizeof(COL_TYPE) == sizeof(int32_t), int32_t, int64_t>>
IndexPair find_null_range_fp (int8_t const *order_col_buf) const
 

Public Attributes

int32_t const * original_col_idx_buf
 
int64_t const * ordered_col_idx_buf
 
int32_t const partition_size
 
int64_t null_bit_pattern = -1
 

Detailed Description

Definition at line 778 of file WindowContext.cpp.

Member Function Documentation

template<typename COL_TYPE , typename NULL_TYPE = std::conditional_t<sizeof(COL_TYPE) == sizeof(int32_t), int32_t, int64_t>>
IndexPair anonymous_namespace{WindowContext.cpp}::FindNullRange::find_null_range_fp ( int8_t const *  order_col_buf) const
inline

Definition at line 819 of file WindowContext.cpp.

819  {
820  IndexPair null_range{std::numeric_limits<int64_t>::max(),
821  std::numeric_limits<int64_t>::min()};
822  auto const casted_order_col_buf = reinterpret_cast<COL_TYPE const*>(order_col_buf);
823  auto check_null_val = [&casted_order_col_buf, this](size_t idx) {
824  return *reinterpret_cast<NULL_TYPE const*>(
825  may_alias_ptr(&casted_order_col_buf
828  };
829  if (check_null_val(0)) {
830  int64_t null_range_max = 1;
831  while (null_range_max < partition_size && check_null_val(null_range_max)) {
832  null_range_max++;
833  }
834  null_range.first = 0;
835  null_range.second = null_range_max - 1;
836  } else if (check_null_val(partition_size - 1)) {
837  int64_t null_range_min = partition_size - 2;
838  while (null_range_min >= 0 && check_null_val(null_range_min)) {
839  null_range_min--;
840  }
841  null_range.first = null_range_min + 1;
842  null_range.second = partition_size - 1;
843  }
844  return null_range;
845  }
std::pair< int64_t, int64_t > IndexPair
template<typename T >
IndexPair anonymous_namespace{WindowContext.cpp}::FindNullRange::find_null_range_int ( int8_t const *  order_col_buf) const
inline

Definition at line 785 of file WindowContext.cpp.

References heavydb.dtypes::T.

785  {
786  IndexPair null_range{std::numeric_limits<int64_t>::max(),
787  std::numeric_limits<int64_t>::min()};
788  auto const null_val = inline_int_null_value<T>();
789  auto const casted_order_col_buf = reinterpret_cast<T const*>(order_col_buf);
790  if (casted_order_col_buf[original_col_idx_buf[ordered_col_idx_buf[0]]] == null_val) {
791  int64_t null_range_max = 1;
792  while (null_range_max < partition_size &&
793  casted_order_col_buf
794  [original_col_idx_buf[ordered_col_idx_buf[null_range_max]]] ==
795  null_val) {
796  null_range_max++;
797  }
798  null_range.first = 0;
799  null_range.second = null_range_max - 1;
800  } else if (casted_order_col_buf
802  null_val) {
803  int64_t null_range_min = partition_size - 2;
804  while (null_range_min >= 0 &&
805  casted_order_col_buf
806  [original_col_idx_buf[ordered_col_idx_buf[null_range_min]]] ==
807  null_val) {
808  null_range_min--;
809  }
810  null_range.first = null_range_min + 1;
811  null_range.second = partition_size - 1;
812  }
813  return null_range;
814  }
std::pair< int64_t, int64_t > IndexPair

Member Data Documentation

int64_t anonymous_namespace{WindowContext.cpp}::FindNullRange::null_bit_pattern = -1

Definition at line 782 of file WindowContext.cpp.

int64_t const* anonymous_namespace{WindowContext.cpp}::FindNullRange::ordered_col_idx_buf

Definition at line 780 of file WindowContext.cpp.

int32_t const* anonymous_namespace{WindowContext.cpp}::FindNullRange::original_col_idx_buf

Definition at line 779 of file WindowContext.cpp.

int32_t const anonymous_namespace{WindowContext.cpp}::FindNullRange::partition_size

Definition at line 781 of file WindowContext.cpp.


The documentation for this struct was generated from the following file: