
**Bug description**
Unlike `cluster()`, `clusterAllReplicas()` does not implement `_shard_num`. 

I would expect
```
SELECT _shard_num
FROM clusterAllReplicas(prod, system.one)
ORDER BY _shard_num ASC
FORMAT PrettyCompactMonoBlock

┌─_shard_num─┐
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
│          0 │
└────────────┘
```
to have an output more useful like
```
SELECT _shard_num
FROM cluster(prod, system.one)
ORDER BY _shard_num ASC
FORMAT PrettyCompactMonoBlock

┌─_shard_num─┐
│          1 │
│          2 │
│          3 │
│          4 │
│          5 │
│          6 │
│          7 │
│          8 │
│          9 │
│         10 │
│         11 │
│         12 │
│         13 │
│         14 │
│         15 │
└────────────┘
```

**Releases where this has been tested**

* v20.3.12.112-stable

**References**

[cluster, clusterAllReplicas documentation](https://clickhouse.tech/docs/en/sql-reference/table-functions/cluster/)

[_shard_num documentation](https://clickhouse.tech/docs/en/engines/table-engines/special/distributed/#virtual-columns)

{
    
    
    
    
    auto select = std::make_shared<ASTSelectQuery>();
    select->setExpression(ASTSelectQuery::Expression::SELECT, std::make_shared<ASTExpressionList>());
    auto count_func = std::make_shared<ASTFunction>();
    count_func->name = "count";
    count_func->arguments = std::make_shared<ASTExpressionList>();
    select->select()->children.push_back(count_func);
    ASTs conditions;
    for (const MutationCommand & command : commands)
    {
        if (ASTPtr condition = getPartitionAndPredicateExpressionForMutationCommand(command, storage, context))
            conditions.push_back(std::move(condition));
    }
    if (conditions.size() > 1)
    {
        auto coalesced_predicates = makeASTFunction("or");
        coalesced_predicates->arguments->children = std::move(conditions);
        select->setExpression(ASTSelectQuery::Expression::WHERE, std::move(coalesced_predicates));
    }
    else if (conditions.size() == 1)
    {
        select->setExpression(ASTSelectQuery::Expression::WHERE, std::move(conditions.front()));
    }
    return select;
}
ColumnDependencies getAllColumnDependencies(const StorageMetadataPtr & metadata_snapshot, const NameSet & updated_columns)