v.21.3New Feature

Add insert_shard_id setting for targeted inserts in distributed tables

Add setting insert_shard_id to support insert data into specific shard from distributed table. #19961 (flynn).
Added the setting insert_shard_id to enable inserting data into a specific shard when working with distributed tables.

Why it matters

This feature allows users to target data insertion to a designated shard within a distributed table, solving the problem of directing inserts precisely in sharded environments. It enhances control over data distribution and can improve data management and performance.

How to use it

Use the setting insert_shard_id when performing inserts into a distributed table to specify the shard id explicitly. Example:

SET insert_shard_id = 1;
INSERT INTO distributed_table (...) VALUES (...);