OmniSciDB  fe05a0c208
 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 31 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().

32  {
33  if (type_info.get_compression() != kENCODING_NONE) {
34  CHECK(type_info.get_compression() == kENCODING_FIXED ||
35  type_info.get_compression() == kENCODING_DICT);
36  auto logical_ti = get_logical_type_info(type_info);
37  if (val == inline_int_null_val(logical_ti)) {
38  return inline_fixed_encoding_null_val(type_info);
39  }
40  }
41  return val;
42 }
SQLTypeInfo get_logical_type_info(const SQLTypeInfo &type_info)
Definition: sqltypes.h:911
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:322
#define CHECK(condition)
Definition: Logger.h:203
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 1002 of file ColumnarResults.cpp.

References UNREACHABLE.

Referenced by ColumnarResults::initReadFunctions().

1005  {
1006  UNREACHABLE() << "Invalid read function used, target should have been skipped.";
1007  return static_cast<int64_t>(0);
1008 }
#define UNREACHABLE()
Definition: Logger.h:247

+ 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 1070 of file ColumnarResults.cpp.

1073  {
1074  auto dval = rows.getEntryAt<double, QUERY_TYPE, COLUMNAR_OUTPUT>(
1075  input_buffer_entry_idx, target_idx, slot_idx);
1076  return *reinterpret_cast<int64_t*>(may_alias_ptr(&dval));
1077 }
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 1060 of file ColumnarResults.cpp.

1063  {
1064  auto fval = rows.getEntryAt<float, QUERY_TYPE, COLUMNAR_OUTPUT>(
1065  input_buffer_entry_idx, target_idx, slot_idx);
1066  return *reinterpret_cast<int32_t*>(may_alias_ptr(&fval));
1067 }
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 1011 of file ColumnarResults.cpp.

1014  {
1015  // float keys in baseline hash are written as doubles in the buffer, so
1016  // the result should properly be casted before being written in the output
1017  // columns
1018  auto fval = static_cast<float>(rows.getEntryAt<double, QUERY_TYPE, COLUMNAR_OUTPUT>(
1019  input_buffer_entry_idx, target_idx, slot_idx));
1020  return *reinterpret_cast<int32_t*>(may_alias_ptr(&fval));
1021 }
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 1042 of file ColumnarResults.cpp.

1045  {
1046  return rows.getEntryAt<int16_t, QUERY_TYPE, COLUMNAR_OUTPUT>(
1047  input_buffer_entry_idx, target_idx, slot_idx);
1048 }
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 1033 of file ColumnarResults.cpp.

1036  {
1037  return rows.getEntryAt<int32_t, QUERY_TYPE, COLUMNAR_OUTPUT>(
1038  input_buffer_entry_idx, target_idx, slot_idx);
1039 }
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 1024 of file ColumnarResults.cpp.

1027  {
1028  return rows.getEntryAt<int64_t, QUERY_TYPE, COLUMNAR_OUTPUT>(
1029  input_buffer_entry_idx, target_idx, slot_idx);
1030 }
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 1051 of file ColumnarResults.cpp.

1054  {
1055  return rows.getEntryAt<int8_t, QUERY_TYPE, COLUMNAR_OUTPUT>(
1056  input_buffer_entry_idx, target_idx, slot_idx);
1057 }