```
milovidov-desktop :) SELECT * FROM (SELECT 'Hello' AS x) PREWHERE toLowCardinality(x) IN ('Hello', 'World')

SELECT *
FROM
(
    SELECT 'Hello' AS x
)
PREWHERE toLowCardinality(x) IN ('Hello', 'World')

Query id: 58d92e01-c67e-4bcc-8b0c-788bb5e1287e


0 rows in set. Elapsed: 0.037 sec. 

Received exception from server (version 21.7.1):
Code: 182. DB::Exception: Received from localhost:9000. DB::Exception: Illegal PREWHERE. 

milovidov-desktop :) SELECT * FROM (SELECT toLowCardinality('Hello') AS x) PREWHERE x IN ('Hello', 'World')

SELECT *
FROM
(
    SELECT toLowCardinality('Hello') AS x
)
PREWHERE x IN ('Hello', 'World')

Query id: 694bbad9-d228-47b8-ad60-c037005c7ee2


0 rows in set. Elapsed: 0.003 sec. 

Received exception from server (version 21.7.1):
Code: 182. DB::Exception: Received from localhost:9000. DB::Exception: Illegal PREWHERE. 

milovidov-desktop :) SELECT * FROM (SELECT toLowCardinality(materialize('Hello')) AS x) PREWHERE x IN ('Hello', 'World')

SELECT *
FROM
(
    SELECT toLowCardinality(materialize('Hello')) AS x
)
PREWHERE x IN ('Hello', 'World')

Query id: fc271924-c17c-457c-8cf8-21d0515388b7


0 rows in set. Elapsed: 0.003 sec. 

Received exception from server (version 21.7.1):
Code: 182. DB::Exception: Received from localhost:9000. DB::Exception: Illegal PREWHERE.
```
{
namespace ErrorCodes
{
    extern const int ILLEGAL_COLUMN;
}
namespace
{
/** in(x, set) - function for evaluating the IN
  * notIn(x, set) - and NOT IN.
  */
template <bool negative, bool global, bool null_is_skipped, bool ignore_set>
struct FunctionInName;
template <> struct FunctionInName<false, false, true, false> { static constexpr auto name = "in"; };
template <> struct FunctionInName<false, true, true, false> { static constexpr auto name = "globalIn"; };
template <> struct FunctionInName<true, false, true, false> { static constexpr auto name = "notIn"; };
template <> struct FunctionInName<true, true, true, false> { static constexpr auto name = "globalNotIn"; };
template <> struct FunctionInName<false, false, false, false> { static constexpr auto name = "nullIn"; };
template <> struct FunctionInName<false, true, false, false> { static constexpr auto name = "globalNullIn"; };
template <> struct FunctionInName<true, false, false, false> { static constexpr auto name = "notNullIn"; };
template <> struct FunctionInName<true, true, false, false> { static constexpr auto name = "globalNotNullIn"; };
template <> struct FunctionInName<false, false, true, true> { static constexpr auto name = "inIgnoreSet"; };
template <> struct FunctionInName<false, true, true, true> { static constexpr auto name = "globalInIgnoreSet"; };
template <> struct FunctionInName<true, false, true, true> { static constexpr auto name = "notInIgnoreSet"; };
template <> struct FunctionInName<true, true, true, true> { static constexpr auto name = "globalNotInIgnoreSet"; };
template <> struct FunctionInName<false, false, false, true> { static constexpr auto name = "nullInIgnoreSet"; };
template <> struct FunctionInName<false, true, false, true> { static constexpr auto name = "globalNullInIgnoreSet"; };
template <> struct FunctionInName<true, false, false, true> { static constexpr auto name = "notNullInIgnoreSet"; };
template <> struct FunctionInName<true, true, false, true> { static constexpr auto name = "globalNotNullInIgnoreSet"; };
template <bool negative, bool global, bool null_is_skipped, bool ignore_set>
class FunctionIn : public IFunction