OmniSciDB  2b310ab3b2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ResultSet.cpp File Reference

Basic constructors and methods of the row set interface. More...

#include "ResultSet.h"
#include "DataMgr/Allocators/CudaAllocator.h"
#include "DataMgr/BufferMgr/BufferMgr.h"
#include "Execute.h"
#include "GpuMemUtils.h"
#include "InPlaceSort.h"
#include "OutputBufferInitialization.h"
#include "RuntimeFunctions.h"
#include "Shared/SqlTypesLayout.h"
#include "Shared/checked_alloc.h"
#include "Shared/likely.h"
#include "Shared/thread_count.h"
#include "Shared/threadpool.h"
#include <algorithm>
#include <bitset>
#include <future>
#include <numeric>
+ Include dependency graph for ResultSet.cpp:

Go to the source code of this file.

Namespaces

 anonymous_namespace{ResultSet.cpp}
 

Functions

std::vector< int64_t > initialize_target_values_for_storage (const std::vector< TargetInfo > &targets)
 
size_t anonymous_namespace{ResultSet.cpp}::get_truncated_row_count (size_t total_row_count, size_t limit, size_t offset)
 
bool can_use_parallel_algorithms (const ResultSet &rows)
 
bool use_parallel_algorithms (const ResultSet &rows)
 

Variables

bool g_use_tbb_pool
 

Detailed Description

Basic constructors and methods of the row set interface.

Author
Alex Suhan alex@.nosp@m.mapd.nosp@m..com Copyright (c) 2014 MapD Technologies, Inc. All rights reserved.

Definition in file ResultSet.cpp.

Function Documentation

bool can_use_parallel_algorithms ( const ResultSet rows)

Definition at line 1003 of file ResultSet.cpp.

Referenced by anonymous_namespace{RelAlgTranslator.cpp}::get_in_values_expr(), RelAlgTranslator::getInIntegerSetExpr(), and use_parallel_algorithms().

1003  {
1004  return !rows.isTruncated();
1005 }

+ Here is the caller graph for this function:

std::vector<int64_t> initialize_target_values_for_storage ( const std::vector< TargetInfo > &  targets)

Definition at line 47 of file ResultSet.cpp.

References kAPPROX_COUNT_DISTINCT, kAVG, kCOUNT, kSAMPLE, null_val_bit_pattern(), and takes_float_argument().

Referenced by GpuSharedMemCodeBuilder::codegenReduction().

48  {
49  std::vector<int64_t> target_init_vals;
50  for (const auto& target_info : targets) {
51  if (target_info.agg_kind == kCOUNT ||
52  target_info.agg_kind == kAPPROX_COUNT_DISTINCT) {
53  target_init_vals.push_back(0);
54  continue;
55  }
56  if (target_info.sql_type.is_column()) {
57  int64_t init_val = null_val_bit_pattern(target_info.sql_type.get_subtype(),
58  takes_float_argument(target_info));
59  target_init_vals.push_back(target_info.is_agg ? init_val : 0);
60  } else if (!target_info.sql_type.get_notnull()) {
61  int64_t init_val =
62  null_val_bit_pattern(target_info.sql_type, takes_float_argument(target_info));
63  target_init_vals.push_back(target_info.is_agg ? init_val : 0);
64  } else {
65  target_init_vals.push_back(target_info.is_agg ? 0xdeadbeef : 0);
66  }
67  if (target_info.agg_kind == kAVG) {
68  target_init_vals.push_back(0);
69  } else if (target_info.agg_kind == kSAMPLE && target_info.sql_type.is_geometry()) {
70  for (int i = 1; i < 2 * target_info.sql_type.get_physical_coord_cols(); i++) {
71  target_init_vals.push_back(0);
72  }
73  } else if (target_info.agg_kind == kSAMPLE && target_info.sql_type.is_varlen()) {
74  target_init_vals.push_back(0);
75  }
76  }
77  return target_init_vals;
78 }
bool takes_float_argument(const TargetInfo &target_info)
Definition: TargetInfo.h:133
int64_t null_val_bit_pattern(const SQLTypeInfo &ti, const bool float_argument_input)
Definition: sqldefs.h:76
Definition: sqldefs.h:72

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool use_parallel_algorithms ( const ResultSet rows)

Definition at line 1007 of file ResultSet.cpp.

References can_use_parallel_algorithms().

Referenced by ColumnarResults::materializeAllLazyColumns(), and synthesize_metadata().

1007  {
1008  return can_use_parallel_algorithms(rows) && rows.entryCount() >= 20000;
1009 }
bool can_use_parallel_algorithms(const ResultSet &rows)
Definition: ResultSet.cpp:1003

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

bool g_use_tbb_pool

Definition at line 76 of file Execute.cpp.