From 9f49ea60a385458626a5b870cfbbf31dac4a1355 Mon Sep 17 00:00:00 2001 From: Sharofbek <55620873+udev-21@users.noreply.github.com> Date: Sun, 20 Oct 2024 03:45:11 +0500 Subject: [PATCH] [clickhouse] fix checkTablesEmptyAndEngine sql query (#2163) --- flow/connectors/clickhouse/clickhouse.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow/connectors/clickhouse/clickhouse.go b/flow/connectors/clickhouse/clickhouse.go index aa3816a384..6328708b72 100644 --- a/flow/connectors/clickhouse/clickhouse.go +++ b/flow/connectors/clickhouse/clickhouse.go @@ -372,7 +372,7 @@ func (c *ClickHouseConnector) checkTablesEmptyAndEngine(ctx context.Context, tab queryInput = append(queryInput, table) } rows, err := c.query(ctx, - fmt.Sprintf("SELECT name,engine,total_rows FROM system.tables WHERE database=? AND table IN (%s)", + fmt.Sprintf("SELECT name,engine,total_rows FROM system.tables WHERE database=? AND name IN (%s)", strings.Join(slices.Repeat([]string{"?"}, len(tables)), ",")), queryInput...) if err != nil { return fmt.Errorf("failed to get information for destination tables: %w", err)