Looks like https://github.com/ClickHouse/ClickHouse/pull/21303 is broke also "clear column" for such columns.

How to reproduce:

```
CREATE TABLE test.TTAdmLog
(
    `ts` DateTime,
    `event_date` Date DEFAULT toDate(ts),
    `impression_id` String DEFAULT '',
    `creative_id` String DEFAULT '',
    `creative_adm` String DEFAULT '',
    `impression_id_compressed` FixedString(16) DEFAULT UUIDStringToNum(impression_id),
    `impression_id_hashed` UInt16 DEFAULT reinterpretAsUInt16(impression_id_compressed),
)
ENGINE = ReplicatedMergeTree('/clickhouse/tables/{shard}/TTAdmLogTest', '{replica}')
PARTITION BY toMonday(event_date)
ORDER BY (event_date, impression_id_hashed)
SAMPLE BY impression_id_hashed
SETTINGS replicated_deduplication_window = 1000, replicated_deduplication_window_seconds = 864000, index_granularity = 8192

CREATE MATERIALIZED VIEW test.TTView
(
    `event_date` Date,
    `creative_id` String,
    `creative_adm` AggregateFunction(anyLast, String),
)
ENGINE = ReplicatedAggregatingMergeTree('/clickhouse/tables/{shard}/TTViewTest', '{replica}', event_date, (event_date, creative_id), 8192) AS
SELECT 
    toStartOfMonth(event_date) AS event_date,
    arrayJoin(splitByChar(',', creative_id)) AS creative_id,
    anyLastState(creative_adm) AS creative_adm,
FROM test.TTAdmLog
GROUP BY 
    event_date,
    creative_id,

```


ClickHouse server version 20.9.3 revision 54439.

```
alter table test.TTAdmLog clear column creative_adm in partition '2021-03-22'

OK

```
ClickHouse server version 21.4.3 revision 54447.

```
alter table test.TTAdmLog  clear column creative_adm in partition '2021-03-22'

DB::Exception: Trying to ALTER DROP column creative_adm which is referenced by materialized view ['TTView'].

```

const StorageInMemoryMetadata & new_metadata, const StorageInMemoryMetadata & old_metadata, bool attach) const
{
    if (!new_metadata.sorting_key.definition_ast)
        throw Exception("ORDER BY cannot be empty", ErrorCodes::BAD_ARGUMENTS);
    KeyDescription new_sorting_key = new_metadata.sorting_key;
    KeyDescription new_primary_key = new_metadata.primary_key;
    size_t sorting_key_size = new_sorting_key.column_names.size();
    size_t primary_key_size = new_primary_key.column_names.size();
    if (primary_key_size > sorting_key_size)
        throw Exception("Primary key must be a prefix of the sorting key, but its length: "
            + toString(primary_key_size) + " is greater than the sorting key length: " + toString(sorting_key_size),
            ErrorCodes::BAD_ARGUMENTS);
    NameSet primary_key_columns_set;
    for (size_t i = 0; i < sorting_key_size; ++i)
    {
        const String & sorting_key_column = new_sorting_key.column_names[i];
        if (i < primary_key_size)
        {
            const String & pk_column = new_primary_key.column_names[i];
            if (pk_column != sorting_key_column)
                throw Exception("Primary key must be a prefix of the sorting key, but the column in the position "
                    + toString(i) + " is " + sorting_key_column +", not " + pk_column,
                    ErrorCodes::BAD_ARGUMENTS);
            if (!primary_key_columns_set.emplace(pk_column).second)
                throw Exception("Primary key contains duplicate columns", ErrorCodes::BAD_ARGUMENTS);