From 092d4da8c3b8baeedcbdaf88bc834f6707725983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Mon, 2 Dec 2024 22:20:39 +0000 Subject: [PATCH] pick value that fits into Decimal(76,38) --- flow/e2e/clickhouse/peer_flow_ch_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/flow/e2e/clickhouse/peer_flow_ch_test.go b/flow/e2e/clickhouse/peer_flow_ch_test.go index 577ea707e..a19e69c8c 100644 --- a/flow/e2e/clickhouse/peer_flow_ch_test.go +++ b/flow/e2e/clickhouse/peer_flow_ch_test.go @@ -603,7 +603,7 @@ func (s ClickHouseSuite) Test_Large_Numeric() { // Unbounded NUMERICs (no precision, scale specified) are mapped to String on CH if FF enabled, Decimal if not func (s ClickHouseSuite) testNumericFF(ffValue bool) { - nine72 := strings.Repeat("9", 72) + nines := strings.Repeat("9", 38) dstTableName := fmt.Sprintf("unumeric_ff_%v", ffValue) srcFullName := s.attachSchemaSuffix(dstTableName) @@ -615,7 +615,7 @@ func (s ClickHouseSuite) testNumericFF(ffValue bool) { `, srcFullName)) require.NoError(s.t, err) - _, err = s.Conn().Exec(context.Background(), fmt.Sprintf("INSERT INTO %s(c) VALUES($1)", srcFullName), nine72) + _, err = s.Conn().Exec(context.Background(), fmt.Sprintf("INSERT INTO %s(c) VALUES($1)", srcFullName), nines) require.NoError(s.t, err) connectionGen := e2e.FlowConnectionGenerationConfig{ @@ -632,7 +632,7 @@ func (s ClickHouseSuite) testNumericFF(ffValue bool) { e2e.EnvWaitForCount(env, s, "waiting for CDC count", dstTableName, "id,c", 1) - _, err = s.Conn().Exec(context.Background(), fmt.Sprintf("INSERT INTO %s(c) VALUES($1)", srcFullName), nine72) + _, err = s.Conn().Exec(context.Background(), fmt.Sprintf("INSERT INTO %s(c) VALUES($1)", srcFullName), nines) require.NoError(s.t, err) e2e.EnvWaitForCount(env, s, "waiting for CDC count", dstTableName, "id,c", 2) @@ -645,11 +645,11 @@ func (s ClickHouseSuite) testNumericFF(ffValue bool) { if ffValue { c, ok := row[0].Value().(string) require.True(s.t, ok, "expected unbounded NUMERIC to be String") - require.Equal(s.t, nine72, c, "expected unbounded NUMERIC to be 72 9s") + require.Equal(s.t, nines, c, "expected unbounded NUMERIC to be 9s") } else { c, ok := row[0].Value().(decimal.Decimal) require.True(s.t, ok, "expected unbounded NUMERIC to be Decimal") - require.Equal(s.t, nine72, c.String(), "expected unbounded NUMERIC to be 72 9s") + require.Equal(s.t, nines, c.String(), "expected unbounded NUMERIC to be 9s") } }