**Describe the bug**
https://clickhouse-test-reports.s3.yandex.net/19387/fb268ec339aeb2cbab0df5137ead3efb8374cc32/fuzzer_debug/server.log

**How to reproduce**
```
SELECT avg(diff) FROM (SELECT * FROM (SELECT learnerHash, passed - eventTime AS diff FROM statements GLOBAL SEMI LEFT JOIN (SELECT learnerHash, argMax(eventTime, resultScoreRaw) AS passed FROM (SELECT learnerHash, eventTime, resultScoreRaw FROM statements WHERE (courseId = 1) AND (onCourse = 1048575) AND (verb = 'http://adlnet.gov/expapi/verbs/passed') AND (objectId = 'https://crmm.ru/xapi/courses/spp/1/1/0-1') ORDER BY eventTime ASC) GROUP BY learnerHash) USING (learnerHash) WHERE resultScoreRaw AND (courseId = 1) AND (onCourse = 0) AND (verb = 'http://adlnet.gov/expapi/verbs/interacted') AND (eventTime <= passed) AND (diff > 0) ORDER BY eventTime DESC LIMIT 0 BY learnerHash) ORDER BY diff DESC LIMIT 7, 126)
```

Looks like query is based on `00586_removing_unused_columns_from_subquery.sql`.

MergeTreeBaseSelectProcessor.cpp:331

```
            auto & ctn = block.getByName(prewhere_info->prewhere_column_name);
            ctn.column = ctn.type->createColumnConst(block.rows(), 1u)->convertToFullColumnIfConst();
```

Looks like `prewhere_column_name` has type Float64.
if (current_preferred_max_column_in_block_size_bytes)
        {
            
            auto rows_to_read_for_max_size_column
                = current_task.size_predictor->estimateNumRowsForMaxSizeColumn(current_preferred_max_column_in_block_size_bytes);
            double filtration_ratio = std::max(min_filtration_ratio, 1.0 - current_task.size_predictor->filtered_rows_ratio);
            auto rows_to_read_for_max_size_column_with_filtration
                = static_cast<size_t>(rows_to_read_for_max_size_column / filtration_ratio);
            
            rows_to_read = std::min(rows_to_read, rows_to_read_for_max_size_column_with_filtration);
        }
        auto unread_rows_in_current_granule = current_reader.numPendingRowsInCurrentGranule();
        if (unread_rows_in_current_granule >= rows_to_read)
            return rows_to_read;
        return index_granularity.countMarksForRows(current_reader.currentMark(), rows_to_read, current_reader.numReadRowsInCurrentGranule());
    };
    UInt64 recommended_rows = estimate_num_rows(*task, task->range_reader);
    UInt64 rows_to_read = std::max(UInt64(1), std::min(current_max_block_size_rows, recommended_rows));
    auto read_result = task->range_reader.read(rows_to_read, task->mark_ranges);
    
    if (read_result.num_rows == 0)
        read_result.columns.clear();
    const auto & sample_block = task->range_reader.getSampleBlock();
    if (read_result.num_rows != 0 && sample_block.columns() != read_result.columns.size())
        throw Exception("Inconsistent number of columns got from MergeTreeRangeReader. "
                        "Have " + toString(sample_block.columns()) + " in sample block "
                        "and " + toString(read_result.columns.size()) + " columns in list", ErrorCodes::LOGICAL_ERROR);
    
    UInt64 num_filtered_rows = read_result.numReadRows() - read_result.num_rows;
    progress({ read_result.numReadRows(), read_result.numBytesRead() });