OmniSciDB  f632821e96
StreamingTopN.h File Reference

Streaming Top N algorithm. More...

#include <cstddef>
#include <cstdint>
#include <vector>
+ Include dependency graph for StreamingTopN.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.




size_t streaming_top_n::get_heap_size (const size_t row_size, const size_t n, const size_t thread_count)
size_t streaming_top_n::get_rows_offset_of_heaps (const size_t n, const size_t thread_count)
std::vector< int8_t > streaming_top_n::get_rows_copy_from_heaps (const int64_t *heaps, const size_t heaps_size, const size_t n, const size_t thread_count)
size_t get_heap_key_slot_index (const std::vector< Analyzer::Expr *> &target_exprs, const size_t target_idx)

Detailed Description

Streaming Top N algorithm.

Minggang Yu Copyright (c) 2017 MapD Technologies, Inc. All rights reserved.

Definition in file StreamingTopN.h.

Function Documentation

◆ get_heap_key_slot_index()

size_t get_heap_key_slot_index ( const std::vector< Analyzer::Expr *> &  target_exprs,
const size_t  target_idx 

Definition at line 46 of file StreamingTopN.cpp.

References advance_slot(), QueryMemoryDescriptor::canOutputColumnar(), CHECK, CHECK_EQ, g_bigint_count, get_heap_key_slot_index(), get_target_info(), QueryMemoryDescriptor::getBufferSizeBytes(), QueryMemoryDescriptor::getColOffInBytes(), QueryMemoryDescriptor::getEffectiveKeyWidth(), QueryMemoryDescriptor::getPaddedSlotWidthBytes(), QueryMemoryDescriptor::getRowSize(), GPU, SortInfo::limit, SortInfo::offset, SortInfo::order_entries, RelAlgExecutionUnit::sort_info, RelAlgExecutionUnit::target_exprs, and PodOrderEntry::tle_no.

Referenced by GroupByAndAggregate::codegenOutputSlot(), and get_heap_key_slot_index().

47  {
48  size_t slot_idx = 0;
49  for (size_t i = 0; i < target_idx; ++i) {
50  auto agg_info = get_target_info(target_exprs[i], g_bigint_count);
51  slot_idx = advance_slot(slot_idx, agg_info, false);
52  }
53  return slot_idx;
54 }
TargetInfo get_target_info(const PointerType target_expr, const bool bigint_count)
Definition: TargetInfo.h:78
size_t advance_slot(const size_t j, const TargetInfo &target_info, const bool separate_varlen_storage)
bool g_bigint_count
+ Here is the call graph for this function:
+ Here is the caller graph for this function: