From a4ac3fb7d31f9f86d28432f75af6c812ad40179a Mon Sep 17 00:00:00 2001 From: Robin Tang Date: Mon, 7 Oct 2024 09:33:51 -0700 Subject: [PATCH] Update comment. --- clients/redshift/cast.go | 4 ++-- clients/redshift/staging.go | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/clients/redshift/cast.go b/clients/redshift/cast.go index 397a17b2f..3a4ed32b7 100644 --- a/clients/redshift/cast.go +++ b/clients/redshift/cast.go @@ -26,8 +26,8 @@ func replaceExceededValues(colVal string, colKind typing.KindDetails, truncateEx } colValLength := int32(len(colVal)) - // If [expandStringPrecision] is enabled and the value is greater than the maximum length, but less than the maximum Redshift length. - if expandStringPrecision && colValLength > maxLength && colValLength < maxRedshiftLength { + // If [expandStringPrecision] is enabled and the value is greater than the maximum length, and lte Redshift's max length. + if expandStringPrecision && colValLength > maxLength && colValLength <= maxRedshiftLength { return Result{Value: colVal, NewLength: colValLength} } diff --git a/clients/redshift/staging.go b/clients/redshift/staging.go index a2ffbc102..c6d3347c6 100644 --- a/clients/redshift/staging.go +++ b/clients/redshift/staging.go @@ -94,7 +94,12 @@ func (s *Store) loadTemporaryTable(tableData *optimization.TableData, newTableID for _, value := range tableData.Rows() { var row []string for _, col := range columns { - result, err := castColValStaging(value[col.Name()], col.KindDetails, s.config.SharedDestinationSettings.TruncateExceededValues, s.config.SharedDestinationSettings.ExpandStringPrecision) + result, err := castColValStaging( + value[col.Name()], + col.KindDetails, + s.config.SharedDestinationSettings.TruncateExceededValues, + s.config.SharedDestinationSettings.ExpandStringPrecision, + ) if err != nil { return "", err }