mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-19 14:11:58 +00:00
37 lines
1.2 KiB
C++
37 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <Columns/IColumn.h>
|
|
|
|
|
|
/// Common helper methods for implementation of different columns.
|
|
|
|
namespace DB
|
|
{
|
|
|
|
/// Counts how many bytes of `filt` are greater than zero.
|
|
size_t countBytesInFilter(const IColumn::Filter & filt);
|
|
|
|
/// Returns vector with num_columns elements. vector[i] is the count of i values in selector.
|
|
/// Selector must contain values from 0 to num_columns - 1. NOTE: this is not checked.
|
|
std::vector<size_t> countColumnsSizeInSelector(IColumn::ColumnIndex num_columns, const IColumn::Selector & selector);
|
|
|
|
/// Returns true, if the memory contains only zeros.
|
|
bool memoryIsZero(const void * data, size_t size);
|
|
|
|
|
|
/// The general implementation of `filter` function for ColumnArray and ColumnString.
|
|
template <typename T>
|
|
void filterArraysImpl(
|
|
const PaddedPODArray<T> & src_elems, const IColumn::Offsets & src_offsets,
|
|
PaddedPODArray<T> & res_elems, IColumn::Offsets & res_offsets,
|
|
const IColumn::Filter & filt, ssize_t result_size_hint);
|
|
|
|
/// Same as above, but not fills res_offsets.
|
|
template <typename T>
|
|
void filterArraysImplOnlyData(
|
|
const PaddedPODArray<T> & src_elems, const IColumn::Offsets & src_offsets,
|
|
PaddedPODArray<T> & res_elems,
|
|
const IColumn::Filter & filt, ssize_t result_size_hint);
|
|
|
|
}
|