Skip to content

Commit

Permalink
Clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Oct 23, 2024
1 parent 952cf23 commit 124de66
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions clients/snowflake/staging.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,18 @@ func (s *Store) writeTemporaryTableFile(tableData *optimization.TableData, newTa
writer.Comma = '\t'

columns := tableData.ReadOnlyInMemoryCols().ValidColumns()
for _, value := range tableData.Rows() {
var row []string
for _, row := range tableData.Rows() {
var csvRow []string
for _, col := range columns {
castedValue, castErr := castColValStaging(value[col.Name()], col.KindDetails)
castedValue, castErr := castColValStaging(row[col.Name()], col.KindDetails)
if castErr != nil {
return "", castErr
return "", fmt.Errorf("failed to cast value '%v': %w", row[col.Name()], castErr)
}

row = append(row, castedValue)
csvRow = append(csvRow, castedValue)
}

if err = writer.Write(row); err != nil {
if err = writer.Write(csvRow); err != nil {
return "", fmt.Errorf("failed to write to csv: %w", err)
}
}
Expand Down

0 comments on commit 124de66

Please sign in to comment.