OmniSciDB  06b3bd477c
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
anonymous_namespace{ColumnarResults.cpp} Namespace Reference

Functions

int64_t fixed_encoding_nullable_val (const int64_t val, const SQLTypeInfo &type_info)
 
int64_t invalid_read_func (const ResultSet &rows, const size_t input_buffer_entry_idx, const size_t target_idx, const size_t slot_idx)
 
template<QueryDescriptionType QUERY_TYPE, bool COLUMNAR_OUTPUT>
int64_t read_float_key_baseline (const ResultSet &rows, const size_t input_buffer_entry_idx, const size_t target_idx, const size_t slot_idx)
 
template<QueryDescriptionType QUERY_TYPE, bool COLUMNAR_OUTPUT>
int64_t read_int64_func (const ResultSet &rows, const size_t input_buffer_entry_idx, const size_t target_idx, const size_t slot_idx)
 
template<QueryDescriptionType QUERY_TYPE, bool COLUMNAR_OUTPUT>
int64_t read_int32_func (const ResultSet &rows, const size_t input_buffer_entry_idx, const size_t target_idx, const size_t slot_idx)
 
template<QueryDescriptionType QUERY_TYPE, bool COLUMNAR_OUTPUT>
int64_t read_int16_func (const ResultSet &rows, const size_t input_buffer_entry_idx, const size_t target_idx, const size_t slot_idx)
 
template<QueryDescriptionType QUERY_TYPE, bool COLUMNAR_OUTPUT>
int64_t read_int8_func (const ResultSet &rows, const size_t input_buffer_entry_idx, const size_t target_idx, const size_t slot_idx)
 
template<QueryDescriptionType QUERY_TYPE, bool COLUMNAR_OUTPUT>
int64_t read_float_func (const ResultSet &rows, const size_t input_buffer_entry_idx, const size_t target_idx, const size_t slot_idx)
 
template<QueryDescriptionType QUERY_TYPE, bool COLUMNAR_OUTPUT>
int64_t read_double_func (const ResultSet &rows, const size_t input_buffer_entry_idx, const size_t target_idx, const size_t slot_idx)
 

Function Documentation

int64_t anonymous_namespace{ColumnarResults.cpp}::fixed_encoding_nullable_val ( const int64_t  val,
const SQLTypeInfo type_info 
)
inline

Definition at line 28 of file ColumnarResults.cpp.

References CHECK(), SQLTypeInfo::get_compression(), get_logical_type_info(), inline_fixed_encoding_null_val(), inline_int_null_val(), kENCODING_DICT, kENCODING_FIXED, and kENCODING_NONE.

Referenced by ColumnarResults::writeBackCell(), and ColumnarResults::writeBackCellDirect().

29  {
30  if (type_info.get_compression() != kENCODING_NONE) {
31  CHECK(type_info.get_compression() == kENCODING_FIXED ||
32  type_info.get_compression() == kENCODING_DICT);
33  auto logical_ti = get_logical_type_info(type_info);
34  if (val == inline_int_null_val(logical_ti)) {
35  return inline_fixed_encoding_null_val(type_info);
36  }
37  }
38  return val;
39 }
SQLTypeInfo get_logical_type_info(const SQLTypeInfo &type_info)
Definition: sqltypes.h:818
CHECK(cgen_state)
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:266
int64_t inline_int_null_val(const SQL_TYPE_INFO &ti)
int64_t inline_fixed_encoding_null_val(const SQL_TYPE_INFO &ti)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int64_t anonymous_namespace{ColumnarResults.cpp}::invalid_read_func ( const ResultSet rows,
const size_t  input_buffer_entry_idx,
const size_t  target_idx,
const size_t  slot_idx 
)

Definition at line 859 of file ColumnarResults.cpp.

References UNREACHABLE.

Referenced by ColumnarResults::initReadFunctions().

862  {
863  UNREACHABLE() << "Invalid read function used, target should have been skipped.";
864  return static_cast<int64_t>(0);
865 }
#define UNREACHABLE()
Definition: Logger.h:241

+ Here is the caller graph for this function:

template<QueryDescriptionType QUERY_TYPE, bool COLUMNAR_OUTPUT>
int64_t anonymous_namespace{ColumnarResults.cpp}::read_double_func ( const ResultSet rows,
const size_t  input_buffer_entry_idx,
const size_t  target_idx,
const size_t  slot_idx 
)

Definition at line 927 of file ColumnarResults.cpp.

930  {
931  auto dval = rows.getEntryAt<double, QUERY_TYPE, COLUMNAR_OUTPUT>(
932  input_buffer_entry_idx, target_idx, slot_idx);
933  return *reinterpret_cast<int64_t*>(may_alias_ptr(&dval));
934 }
template<QueryDescriptionType QUERY_TYPE, bool COLUMNAR_OUTPUT>
int64_t anonymous_namespace{ColumnarResults.cpp}::read_float_func ( const ResultSet rows,
const size_t  input_buffer_entry_idx,
const size_t  target_idx,
const size_t  slot_idx 
)

Definition at line 917 of file ColumnarResults.cpp.

920  {
921  auto fval = rows.getEntryAt<float, QUERY_TYPE, COLUMNAR_OUTPUT>(
922  input_buffer_entry_idx, target_idx, slot_idx);
923  return *reinterpret_cast<int32_t*>(may_alias_ptr(&fval));
924 }
template<QueryDescriptionType QUERY_TYPE, bool COLUMNAR_OUTPUT>
int64_t anonymous_namespace{ColumnarResults.cpp}::read_float_key_baseline ( const ResultSet rows,
const size_t  input_buffer_entry_idx,
const size_t  target_idx,
const size_t  slot_idx 
)

Definition at line 868 of file ColumnarResults.cpp.

871  {
872  // float keys in baseline hash are written as doubles in the buffer, so
873  // the result should properly be casted before being written in the output
874  // columns
875  auto fval = static_cast<float>(rows.getEntryAt<double, QUERY_TYPE, COLUMNAR_OUTPUT>(
876  input_buffer_entry_idx, target_idx, slot_idx));
877  return *reinterpret_cast<int32_t*>(may_alias_ptr(&fval));
878 }
template<QueryDescriptionType QUERY_TYPE, bool COLUMNAR_OUTPUT>
int64_t anonymous_namespace{ColumnarResults.cpp}::read_int16_func ( const ResultSet rows,
const size_t  input_buffer_entry_idx,
const size_t  target_idx,
const size_t  slot_idx 
)

Definition at line 899 of file ColumnarResults.cpp.

902  {
903  return rows.getEntryAt<int16_t, QUERY_TYPE, COLUMNAR_OUTPUT>(
904  input_buffer_entry_idx, target_idx, slot_idx);
905 }
template<QueryDescriptionType QUERY_TYPE, bool COLUMNAR_OUTPUT>
int64_t anonymous_namespace{ColumnarResults.cpp}::read_int32_func ( const ResultSet rows,
const size_t  input_buffer_entry_idx,
const size_t  target_idx,
const size_t  slot_idx 
)

Definition at line 890 of file ColumnarResults.cpp.

893  {
894  return rows.getEntryAt<int32_t, QUERY_TYPE, COLUMNAR_OUTPUT>(
895  input_buffer_entry_idx, target_idx, slot_idx);
896 }
template<QueryDescriptionType QUERY_TYPE, bool COLUMNAR_OUTPUT>
int64_t anonymous_namespace{ColumnarResults.cpp}::read_int64_func ( const ResultSet rows,
const size_t  input_buffer_entry_idx,
const size_t  target_idx,
const size_t  slot_idx 
)

Definition at line 881 of file ColumnarResults.cpp.

884  {
885  return rows.getEntryAt<int64_t, QUERY_TYPE, COLUMNAR_OUTPUT>(
886  input_buffer_entry_idx, target_idx, slot_idx);
887 }
template<QueryDescriptionType QUERY_TYPE, bool COLUMNAR_OUTPUT>
int64_t anonymous_namespace{ColumnarResults.cpp}::read_int8_func ( const ResultSet rows,
const size_t  input_buffer_entry_idx,
const size_t  target_idx,
const size_t  slot_idx 
)

Definition at line 908 of file ColumnarResults.cpp.

911  {
912  return rows.getEntryAt<int8_t, QUERY_TYPE, COLUMNAR_OUTPUT>(
913  input_buffer_entry_idx, target_idx, slot_idx);
914 }