The Distributed engine creates a distributed table across a ClickHouse cluster for horizontal scaling:
import { OlapTable, ClickHouseEngines } from '@514labs/moose-lib'; // Distributed table across clusterexport const distributedTable = new OlapTable<Record>("distributed_data", { engine: ClickHouseEngines.Distributed, cluster: "my_cluster", targetDatabase: "default", targetTable: "local_table", shardingKey: "cityHash64(id)" // Optional: how to distribute data});orderByFields, partitionBy, or sampleByExpression on distributed tablescluster name must match a cluster defined in your ClickHouse configurationimport { OlapTable, ClickHouseEngines } from '@514labs/moose-lib'; // Distributed table across clusterexport const distributedTable = new OlapTable<Record>("distributed_data", { engine: ClickHouseEngines.Distributed, cluster: "my_cluster", targetDatabase: "default", targetTable: "local_table", shardingKey: "cityHash64(id)" // Optional: how to distribute data});