mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-12 02:23:14 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
39 lines
1014 B
C++
39 lines
1014 B
C++
#pragma once
|
|
|
|
#include <Columns/IColumn.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
/// Support methods for implementation of WHERE, PREWHERE and HAVING.
|
|
|
|
|
|
/// Analyze if the column for filter is constant thus filter is always false or always true.
|
|
struct ConstantFilterDescription
|
|
{
|
|
bool always_false = false;
|
|
bool always_true = false;
|
|
|
|
ConstantFilterDescription() {}
|
|
explicit ConstantFilterDescription(const IColumn & column);
|
|
};
|
|
|
|
|
|
/// Obtain a filter from non constant Column, that may have type: UInt8, Nullable(UInt8).
|
|
struct FilterDescription
|
|
{
|
|
const IColumn::Filter * data = nullptr; /// Pointer to filter when it is not always true or always false.
|
|
ColumnPtr data_holder; /// If new column was generated, it will be owned by holder.
|
|
|
|
explicit FilterDescription(const IColumn & column);
|
|
};
|
|
|
|
|
|
struct ColumnWithTypeAndName;
|
|
|
|
/// Will throw an exception if column_elem is cannot be used as a filter column.
|
|
void checkColumnCanBeUsedAsFilter(const ColumnWithTypeAndName & column_elem);
|
|
|
|
}
|