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'].

```

*/
    auto modified_context = Context::createCopy(local_context);
    modified_context->setSetting("optimize_move_to_prewhere", false);
    
    Block header = getHeaderForProcessingStage(*this, column_names, metadata_snapshot, query_info, local_context, processed_stage);
    /** First we make list of selected tables to find out its size.
      * This is necessary to correctly pass the recommended number of threads to each table.
      */
    StorageListWithLocks selected_tables = getSelectedTables(local_context, query_info.query, has_table_virtual_column);
    if (selected_tables.empty())
        
        return createSources(
            {}, query_info, processed_stage, max_block_size, header, {}, real_column_names, modified_context, 0, has_table_virtual_column);
    size_t tables_count = selected_tables.size();
    Float64 num_streams_multiplier
        = std::min(unsigned(tables_count), std::max(1U, unsigned(local_context->getSettingsRef().max_streams_multiplier_for_merge_tables)));
    num_streams *= num_streams_multiplier;
    size_t remaining_streams = num_streams;
    InputOrderInfoPtr input_sorting_info;
    if (query_info.order_optimizer)
    {
        for (auto it = selected_tables.begin(); it != selected_tables.end(); ++it)
        {
            auto storage_ptr = std::get<0>(*it);
            auto storage_metadata_snapshot = storage_ptr->getInMemoryMetadataPtr();
            auto current_info = query_info.order_optimizer->getInputOrder(storage_metadata_snapshot, local_context);
            if (it == selected_tables.begin())
                input_sorting_info = current_info;
            else if (!current_info || (input_sorting_info && *current_info != *input_sorting_info))
                input_sorting_info.reset();