From 16719425116249fc40780649ca6222f587eece52 Mon Sep 17 00:00:00 2001 From: Robin Tang Date: Wed, 20 Nov 2024 17:03:02 -0800 Subject: [PATCH] [BigQuery] Use `BIGNUMERIC` (#1063) --- clients/shared/merge.go | 2 +- lib/typing/decimal/details.go | 2 +- lib/typing/decimal/details_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/clients/shared/merge.go b/clients/shared/merge.go index 24aeb19d6..2d4fb20d2 100644 --- a/clients/shared/merge.go +++ b/clients/shared/merge.go @@ -64,7 +64,7 @@ func Merge(ctx context.Context, dwh destination.DataWarehouse, tableData *optimi } }() - if err = dwh.PrepareTemporaryTable(ctx, tableData, tableConfig, temporaryTableID, tableID, types.AdditionalSettings{}, true); err != nil { + if err = dwh.PrepareTemporaryTable(ctx, tableData, tableConfig, temporaryTableID, tableID, types.AdditionalSettings{ColumnSettings: opts.ColumnSettings}, true); err != nil { return fmt.Errorf("failed to prepare temporary table: %w", err) } diff --git a/lib/typing/decimal/details.go b/lib/typing/decimal/details.go index c0b6355ef..4afaa5848 100644 --- a/lib/typing/decimal/details.go +++ b/lib/typing/decimal/details.go @@ -72,7 +72,7 @@ func (d Details) RedshiftKind() string { // BigQueryKind - is inferring logic from: https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#decimal_types func (d Details) BigQueryKind(numericTypeForVariableNumeric bool) string { if numericTypeForVariableNumeric && d.precision == PrecisionNotSpecified { - return "NUMERIC" + return "BIGNUMERIC" } if d.isNumeric() { diff --git a/lib/typing/decimal/details_test.go b/lib/typing/decimal/details_test.go index 966be36da..5ca4e561a 100644 --- a/lib/typing/decimal/details_test.go +++ b/lib/typing/decimal/details_test.go @@ -15,7 +15,7 @@ func TestDetails_BigQueryKind(t *testing.T) { } { // numericTypeForVariableNumeric = true - assert.Equal(t, "NUMERIC", details.BigQueryKind(true)) + assert.Equal(t, "BIGNUMERIC", details.BigQueryKind(true)) } }