Skip to content

Commit

Permalink
Update comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Oct 7, 2024
1 parent ac863e6 commit a4ac3fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions clients/redshift/cast.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}

Expand Down
7 changes: 6 additions & 1 deletion clients/redshift/staging.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit a4ac3fb

Please sign in to comment.