ClickHouse/dbms/tests/queries/0_stateless/01018_Distributed__shard_num.reference
Azat Khuzhin 81aeff2d2a Add _shard_num virtual column for the Distributed engine
With JOIN from system.clusters one can figure out from which server data
came.

TODO:
- optimization to avoid communicating with unrelated shards (for queries
  like "AND _shard_num = n")
- fix aliases (see tests with serverError expected)

v0: AddingConstColumnBlockInputStream
v2: VirtualColumnUtils::rewriteEntityInAst
v3: fix remote(Distributed) by appending _shard_num only if has been requested
2019-11-06 15:26:12 +03:00

37 lines
285 B
Plaintext

remote(system.one)
0
0
0
1 0
1 0
2 0
1 0
dist_1
1
1 10
10
1
1
1 10
1 20
10
20
dist_2
1
2
1 100
2 100
100
100
remote(Distributed)
1 100
1 100
JOIN system.clusters
1 10 localhost ::1 9000
1 20 localhost ::1 9000
1 10 localhost ::1 9000
1 20 localhost ::1 9000
dist_3
100 foo
foo 100 foo