{
    bool has_res = false;
    for (int i = static_cast<int>(in.size()) - 1; i >= 0; --i)
    {
        if (!isColumnConst(*in[i]))
            continue;
        UInt8 x = func((*in[i])[0]);
        if (has_res)
        {
            res = Op::apply(res, x);
        }
        else
        {
            res = x;
            has_res = true;
        }
        in.erase(in.begin() + i);
    }
    return has_res;
}
template <class Op>
inline bool extractConstColumnsAsBool(ColumnRawPtrs & in, UInt8 & res)