#pragma once #include /// 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 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 void filterArraysImpl( const PaddedPODArray & src_elems, const IColumn::Offsets & src_offsets, PaddedPODArray & res_elems, IColumn::Offsets & res_offsets, const IColumn::Filter & filt, ssize_t result_size_hint); /// Same as above, but not fills res_offsets. template void filterArraysImplOnlyData( const PaddedPODArray & src_elems, const IColumn::Offsets & src_offsets, PaddedPODArray & res_elems, const IColumn::Filter & filt, ssize_t result_size_hint); }