```
select value % -9223372036854775808 from (select toInt32(arrayJoin([3, 5])) value)
```

Server dies (aborted), no stacktraces, only the subject line in log. Does not reproduce on playground for some reason.
{
    const auto & shard_info = cluster->getShardsInfo()[shard_id];
    const auto & settings = context.getSettingsRef();
    if (shard_info.hasInternalReplication())
    {
        if (shard_info.isLocal() && settings.prefer_localhost_replica)
            
            writeToLocal(block, shard_info.getLocalNodeCount());
        else
            writeToShard(block, {shard_info.pathForInsert(settings.prefer_localhost_replica)});
    }
    else
    {
        if (shard_info.isLocal() && settings.prefer_localhost_replica)
            writeToLocal(block, shard_info.getLocalNodeCount());
        std::vector<std::string> dir_names;
        for (const auto & address : cluster->getShardsAddresses()[shard_id])
            if (!address.is_local || !settings.prefer_localhost_replica)
                dir_names.push_back(address.toFullString(settings.use_compact_format_in_distributed_parts_names));
        if (!dir_names.empty())
            writeToShard(block, dir_names);
    }
}
void DistributedBlockOutputStream::writeToLocal(const Block & block, const size_t repeats)