**Describe the bug**
`SELECT i FROM generateRandom('i Array(Int8)', 1048575, 10, 1048577) LIMIT 1048575`

Memory limit should be respected.
{
    for (const auto & command : commands)
    {
        if (command.type != AlterCommand::Type::ADD_COLUMN && command.type != AlterCommand::Type::MODIFY_COLUMN
            && command.type != AlterCommand::Type::DROP_COLUMN && command.type != AlterCommand::Type::COMMENT_COLUMN)
            throw Exception(
                "Alter of type '" + alterTypeToString(command.type) + "' is not supported by storage " + getName(),
                ErrorCodes::NOT_IMPLEMENTED);
    }
}
std::optional<UInt64> StorageBuffer::totalRows() const
{
    std::optional<UInt64> underlying_rows;
    auto underlying = DatabaseCatalog::instance().tryGetTable(destination_id, global_context);
    if (underlying)
        underlying_rows = underlying->totalRows();
    if (!underlying_rows)
        return underlying_rows;
    UInt64 rows = 0;
    for (const auto & buffer : buffers)
    {
        std::lock_guard lock(buffer.mutex);
        rows += buffer.data.rows();
    }
    return rows + *underlying_rows;
}
std::optional<UInt64> StorageBuffer::totalBytes() const