OmniSciDB
a5dc49c757
|
#include "QueryEngine/WindowContext.h"
#include <numeric>
#include "QueryEngine/Descriptors/CountDistinctDescriptor.h"
#include "QueryEngine/Execute.h"
#include "QueryEngine/OutputBufferInitialization.h"
#include "QueryEngine/ResultSetBufferAccessors.h"
#include "QueryEngine/RuntimeFunctions.h"
#include "QueryEngine/TypePunning.h"
#include "QueryEngine/Utils/SegmentTree.h"
#include "Shared/Intervals.h"
#include "Shared/checked_alloc.h"
#include "Shared/funcannotations.h"
#include "Shared/sqltypes.h"
#include "Shared/threading.h"
#include <thrust/sort.h>
Go to the source code of this file.
Classes | |
struct | anonymous_namespace{WindowContext.cpp}::FindNullRange |
Namespaces | |
anonymous_namespace{WindowContext.cpp} | |
Functions | |
std::vector< int64_t > | anonymous_namespace{WindowContext.cpp}::index_to_row_number (const int64_t *index, const size_t index_size) |
bool | anonymous_namespace{WindowContext.cpp}::advance_current_rank (const std::function< bool(const int64_t lhs, const int64_t rhs)> &comparator, const int64_t *index, const size_t i) |
std::vector< int64_t > | anonymous_namespace{WindowContext.cpp}::index_to_rank (const int64_t *index, const size_t index_size, const std::function< bool(const int64_t lhs, const int64_t rhs)> &comparator) |
std::vector< int64_t > | anonymous_namespace{WindowContext.cpp}::index_to_dense_rank (const int64_t *index, const size_t index_size, const std::function< bool(const int64_t lhs, const int64_t rhs)> &comparator) |
std::vector< double > | anonymous_namespace{WindowContext.cpp}::index_to_percent_rank (const int64_t *index, const size_t index_size, const std::function< bool(const int64_t lhs, const int64_t rhs)> &comparator) |
std::vector< double > | anonymous_namespace{WindowContext.cpp}::index_to_cume_dist (const int64_t *index, const size_t index_size, const std::function< bool(const int64_t lhs, const int64_t rhs)> &comparator) |
std::vector< int64_t > | anonymous_namespace{WindowContext.cpp}::index_to_ntile (const int64_t *index, const size_t index_size, const size_t n) |
size_t | anonymous_namespace{WindowContext.cpp}::window_function_buffer_element_size (const SqlWindowFunctionKind) |
size_t | anonymous_namespace{WindowContext.cpp}::get_int_constant_from_expr (const Analyzer::Expr *expr) |
int64_t | anonymous_namespace{WindowContext.cpp}::get_lag_or_lead_argument (const Analyzer::WindowFunction *window_func) |
size_t | anonymous_namespace{WindowContext.cpp}::get_target_idx_for_first_or_last_value_func (const Analyzer::WindowFunction *window_func, const size_t partition_size) |
void | anonymous_namespace{WindowContext.cpp}::apply_permutation_to_partition (int64_t *output_for_partition_buff, const int32_t *original_indices, const size_t partition_size) |
void | anonymous_namespace{WindowContext.cpp}::apply_lag_to_partition (const int64_t lag, const int32_t *original_indices, int64_t *sorted_indices, const size_t partition_size) |
void | anonymous_namespace{WindowContext.cpp}::apply_nth_value_to_partition (const int32_t *original_indices, int64_t *output_for_partition_buff, const size_t partition_size, const size_t target_pos) |
void | anonymous_namespace{WindowContext.cpp}::apply_original_index_to_partition (const int32_t *original_indices, int64_t *output_for_partition_buff, const size_t partition_size) |
void | anonymous_namespace{WindowContext.cpp}::index_to_partition_end (const int8_t *partition_end, const size_t off, const int64_t *index, const size_t index_size, const std::function< bool(const int64_t lhs, const int64_t rhs)> &comparator) |
bool | anonymous_namespace{WindowContext.cpp}::pos_is_set (const int64_t bitset, const int64_t pos) |
template<class T > | |
void | anonymous_namespace{WindowContext.cpp}::apply_window_pending_outputs_int (const int64_t handle, const int64_t value, const int64_t bitset, const int64_t pos) |
RUNTIME_EXPORT void | apply_window_pending_outputs_int64 (const int64_t handle, const int64_t value, const int64_t bitset, const int64_t pos) |
RUNTIME_EXPORT void | apply_window_pending_outputs_int32 (const int64_t handle, const int64_t value, const int64_t bitset, const int64_t pos) |
RUNTIME_EXPORT void | apply_window_pending_outputs_int16 (const int64_t handle, const int64_t value, const int64_t bitset, const int64_t pos) |
RUNTIME_EXPORT void | apply_window_pending_outputs_int8 (const int64_t handle, const int64_t value, const int64_t bitset, const int64_t pos) |
RUNTIME_EXPORT void | apply_window_pending_outputs_double (const int64_t handle, const double value, const int64_t bitset, const int64_t pos) |
RUNTIME_EXPORT void | apply_window_pending_outputs_float (const int64_t handle, const float value, const int64_t bitset, const int64_t pos) |
RUNTIME_EXPORT void | apply_window_pending_outputs_float_columnar (const int64_t handle, const float value, const int64_t bitset, const int64_t pos) |
RUNTIME_EXPORT void | add_window_pending_output (void *pending_output, const int64_t handle) |
bool | window_function_requires_peer_handling (const Analyzer::WindowFunction *window_func) |
template<class T > | |
WindowFunctionContext::WindowComparatorResult | anonymous_namespace{WindowContext.cpp}::integer_comparator_asc (const int8_t *order_column_buffer, const SQLTypeInfo &ti, const int32_t *partition_indices, const int64_t lhs, const int64_t rhs, const bool asc_ordering, const bool nulls_first) |
template<class T > | |
WindowFunctionContext::WindowComparatorResult | anonymous_namespace{WindowContext.cpp}::integer_comparator_desc (const int8_t *order_column_buffer, const SQLTypeInfo &ti, const int32_t *partition_indices, const int64_t lhs, const int64_t rhs, const bool asc_ordering, const bool nulls_first) |
template<class T , class NullPatternType > | |
WindowFunctionContext::WindowComparatorResult | anonymous_namespace{WindowContext.cpp}::fp_comparator_asc (const int8_t *order_column_buffer, const SQLTypeInfo &ti, const int32_t *partition_indices, const int64_t lhs, const int64_t rhs, const bool asc_ordering, const bool nulls_first) |
template<class T , class NullPatternType > | |
WindowFunctionContext::WindowComparatorResult | anonymous_namespace{WindowContext.cpp}::fp_comparator_desc (const int8_t *order_column_buffer, const SQLTypeInfo &ti, const int32_t *partition_indices, const int64_t lhs, const int64_t rhs, const bool asc_ordering, const bool nulls_first) |
bool | anonymous_namespace{WindowContext.cpp}::allow_framing_on_time_or_date (SqlWindowFunctionKind kind) |
Variables | |
bool | g_enable_parallel_window_partition_compute {true} |
size_t | g_parallel_window_partition_compute_threshold {1 << 12} |
bool | g_enable_parallel_window_partition_sort {true} |
size_t | g_parallel_window_partition_sort_threshold {1 << 10} |
size_t | g_window_function_aggregation_tree_fanout {8} |
RUNTIME_EXPORT void add_window_pending_output | ( | void * | pending_output, |
const int64_t | handle | ||
) |
Definition at line 524 of file WindowContext.cpp.
RUNTIME_EXPORT void apply_window_pending_outputs_double | ( | const int64_t | handle, |
const double | value, | ||
const int64_t | bitset, | ||
const int64_t | pos | ||
) |
Definition at line 480 of file WindowContext.cpp.
References anonymous_namespace{WindowContext.cpp}::pos_is_set().
RUNTIME_EXPORT void apply_window_pending_outputs_float | ( | const int64_t | handle, |
const float | value, | ||
const int64_t | bitset, | ||
const int64_t | pos | ||
) |
Definition at line 494 of file WindowContext.cpp.
References anonymous_namespace{WindowContext.cpp}::pos_is_set().
RUNTIME_EXPORT void apply_window_pending_outputs_float_columnar | ( | const int64_t | handle, |
const float | value, | ||
const int64_t | bitset, | ||
const int64_t | pos | ||
) |
Definition at line 508 of file WindowContext.cpp.
References anonymous_namespace{WindowContext.cpp}::pos_is_set().
RUNTIME_EXPORT void apply_window_pending_outputs_int16 | ( | const int64_t | handle, |
const int64_t | value, | ||
const int64_t | bitset, | ||
const int64_t | pos | ||
) |
Definition at line 466 of file WindowContext.cpp.
RUNTIME_EXPORT void apply_window_pending_outputs_int32 | ( | const int64_t | handle, |
const int64_t | value, | ||
const int64_t | bitset, | ||
const int64_t | pos | ||
) |
Definition at line 459 of file WindowContext.cpp.
RUNTIME_EXPORT void apply_window_pending_outputs_int64 | ( | const int64_t | handle, |
const int64_t | value, | ||
const int64_t | bitset, | ||
const int64_t | pos | ||
) |
Definition at line 452 of file WindowContext.cpp.
RUNTIME_EXPORT void apply_window_pending_outputs_int8 | ( | const int64_t | handle, |
const int64_t | value, | ||
const int64_t | bitset, | ||
const int64_t | pos | ||
) |
Definition at line 473 of file WindowContext.cpp.
bool window_function_requires_peer_handling | ( | const Analyzer::WindowFunction * | window_func | ) |
Definition at line 531 of file WindowContext.cpp.
References Analyzer::WindowFunction::getKind(), Analyzer::WindowFunction::getOrderKeys(), MAX, MIN, and window_function_is_aggregate().
Referenced by TargetExprCodegen::codegenAggregate(), WindowFunctionContext::compute(), and WindowFunctionContext::computePartitionBuffer().
bool g_enable_parallel_window_partition_compute {true} |
Definition at line 41 of file WindowContext.cpp.
Referenced by WindowFunctionContext::compute(), and CommandLineOptions::fillDeveloperOptions().
bool g_enable_parallel_window_partition_sort {true} |
Definition at line 44 of file WindowContext.cpp.
Referenced by CommandLineOptions::fillDeveloperOptions().
size_t g_parallel_window_partition_compute_threshold {1 << 12} |
Definition at line 42 of file WindowContext.cpp.
Referenced by WindowFunctionContext::compute().
size_t g_parallel_window_partition_sort_threshold {1 << 10} |
Definition at line 45 of file WindowContext.cpp.
size_t g_window_function_aggregation_tree_fanout {8} |
Definition at line 47 of file WindowContext.cpp.
Referenced by RelAlgExecutor::createWindowFunctionContext(), and CommandLineOptions::fillDeveloperOptions().