Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/managing-data/core-concepts/shards.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ENGINE = Distributed('test_cluster', 'uk', 'uk_price_paid_simple', rand())

The `ON CLUSTER` clause makes the DDL statement a [distributed DDL statement](/docs/sql-reference/distributed-ddl), instructing ClickHouse to create the table on all servers listed in the `test_cluster` [cluster definition](/docs/architecture/horizontal-scaling#replication-and-sharding-configuration). Distributed DDL requires an additional [Keeper](https://clickhouse.com/clickhouse/keeper) component in the [cluster architecture](/docs/architecture/horizontal-scaling#architecture-diagram).

For the [distributed engine parameters](/docs/engines/table-engines/special/distributed#distributed-parameters), we specify the cluster name (`test_cluster`), the database name (`uk`) for the sharded target table, the sharded target table's name (`uk_price_paid_simple`), and the **sharding key** for INSERT routing. In this example, we use the [rand]((/sql-reference/functions/random-functions#rand)) function to randomly assign rows to shards. However, any expression—even complex ones—can be used as a sharding key, depending on the use case. The next section illustrates how INSERT routing works.
For the [distributed engine parameters](/docs/engines/table-engines/special/distributed#distributed-parameters), we specify the cluster name (`test_cluster`), the database name (`uk`) for the sharded target table, the sharded target table's name (`uk_price_paid_simple`), and the **sharding key** for INSERT routing. In this example, we use the [rand](/sql-reference/functions/random-functions#rand) function to randomly assign rows to shards. However, any expression—even complex ones—can be used as a sharding key, depending on the use case. The next section illustrates how INSERT routing works.

## INSERT routing {#insert-routing}

Expand Down
4 changes: 4 additions & 0 deletions scripts/generate-changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ if grep -q "^# $(date +%Y) Changelog" "$parent_dir/tmp/CHANGELOG.md"; then
echo "Generating $(date +%Y) Changelog..."
sed "/^# $(date +%Y) Changelog/d" "$parent_dir/tmp/CHANGELOG.md" > temp.txt
echo "Changelog copied to temp.txt"
# Changelog has <a id="252"/></a> in it which docusaurus onBrokenAnchor will fail on
# This line is to swap them out for explicit anchor ids rather
sed -i.bak -E 's/### <a id="([0-9]+)"><\/a> (.*)/### \2 {#\1}/g' temp.txt
cat temp.txt >> "$parent_dir/../docs/whats-new/changelog/index.md"
echo "Changelog written to docs/en/whats-new/changelog/index.md"
rm -f temp.txt
rm -f temp.txt.bak
echo "$(date +%Y) Changelog was updated."
else
current_year="$(date +%Y)"
Expand Down