From 63d97f4c1353c23d665b3c8b13ca70e831ae529f Mon Sep 17 00:00:00 2001 From: YenchangChan Date: Wed, 20 Mar 2024 16:53:01 +0800 Subject: [PATCH] fix: logic table not sync schema --- output/clickhouse.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/output/clickhouse.go b/output/clickhouse.go index d246c8d3..76998994 100644 --- a/output/clickhouse.go +++ b/output/clickhouse.go @@ -622,8 +622,8 @@ func (c *ClickHouse) getDistTbls(table string) (distTbls []DistTblInfo, err erro return } query := fmt.Sprintf(`SELECT name, (extractAllGroups(engine_full, '(Distributed\\(\')(.*)\',\\s+\'(.*)\',\\s+\'(.*)\'(.*)')[1])[2] AS cluster - FROM system.tables WHERE engine='Distributed' AND database='%s' AND match(engine_full, 'Distributed\(\'%s\', \'%s\', \'%s\'.*\)')`, - c.dbName, c.cfg.Clickhouse.Cluster, c.dbName, table) + FROM system.tables WHERE engine='Distributed' AND database='%s' AND match(engine_full, 'Distributed\(\'.*\', \'%s\', \'%s\'.*\)')`, + c.dbName, c.dbName, table) util.Logger.Info(fmt.Sprintf("executing sql=> %s", query), zap.String("task", taskCfg.Name)) var rows *pool.Rows if rows, err = conn.Query(query); err != nil {