21.5.1
```sql

create table test(d Date, k Int64, s String) 
Engine=MergeTree partition by (toYYYYMM(d),k) order by (d, k)

insert into test values ('2020-01-01', 1, '');
insert into test values ('2020-01-02', 1, '');

SELECT * FROM test WHERE d != '2020-01-01'
0 rows in set. Elapsed: 0.003 sec.


SELECT * FROM test WHERE identity(d) !=  '2020-01-01';
┌──────────d─┬─k─┬─s─┐
│ 2020-01-02 │ 1 │   │
└────────────┴───┴───┘

SELECT * FROM test WHERE toDate(d) != '2020-01-01';
┌──────────d─┬─k─┬─s─┐
│ 2020-01-02 │ 1 │   │
└────────────┴───┴───┘
```

const std::vector<Range> & hyperrectangle,
    const DataTypes & data_types) const
{
    std::vector<BoolMask> rpn_stack;
    for (const auto & element : rpn)
    {
        if (element.function == RPNElement::FUNCTION_UNKNOWN)
        {
            rpn_stack.emplace_back(true, true);
        }
        else if (element.function == RPNElement::FUNCTION_IN_RANGE
            || element.function == RPNElement::FUNCTION_NOT_IN_RANGE)
        {
            const Range * key_range = &hyperrectangle[element.key_column];
            
            Range transformed_range;
            if (!element.monotonic_functions_chain.empty())
            {
                std::optional<Range> new_range = applyMonotonicFunctionsChainToRange(
                    *key_range,
                    element.monotonic_functions_chain,
                    data_types[element.key_column],
                    single_point
                );
                if (!new_range)