Skip to content

Commit 666e122

Browse files
committed
Changed cluster function to list of remote hosts.
1 parent a13ca0e commit 666e122

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/model/schemer.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ func (s *Schemer) getObjectListFromClickHouse(serviceUrl string, sql string) ([]
8383
// GetCreateDistributedObjects returns a list of objects that needs to be created on a shard in a cluster
8484
// That includes all Distributed tables, corresponding local tables, and databases, if necessary
8585
func (s *Schemer) ClusterGetCreateDistributedObjects(chi *chop.ClickHouseInstallation, cluster *chop.ChiCluster) ([]string, []string, error) {
86-
system_tables := fmt.Sprintf("cluster('%s', system, tables)", cluster.Name)
86+
// system_tables := fmt.Sprintf("cluster('%s', system, tables)", cluster.Name)
87+
hosts := CreatePodFQDNsOfCluster(cluster)
88+
system_tables := fmt.Sprintf("remote('%s', system, tables)", strings.Join(hosts, ","))
89+
8790
sql := heredoc.Doc(strings.ReplaceAll(`
8891
SELECT DISTINCT
8992
database AS name,

0 commit comments

Comments
 (0)