Skip to content

Commit

Permalink
Specify column names on Target.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Jun 18, 2024
1 parent 1258dbc commit 31cab7e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clients/bigquery/bigquery.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ func (s *Store) Append(tableData *optimization.TableData, useTempTable bool) err
return fmt.Errorf("failed to append: %w", err)
}

query := fmt.Sprintf(`INSERT INTO %s SELECT %s FROM %s`,
query := fmt.Sprintf(`INSERT INTO %s (%s) SELECT %s FROM %s`,
tableID.FullyQualifiedName(),
strings.Join(sql.QuoteIdentifiers(tableData.ReadOnlyInMemoryCols().GetColumnsToUpdate(), s.Dialect()), ","),
strings.Join(sql.QuoteIdentifiers(tableData.ReadOnlyInMemoryCols().GetColumnsToUpdate(), s.Dialect()), ","),
temporaryTableID.FullyQualifiedName(),
)

Expand Down

0 comments on commit 31cab7e

Please sign in to comment.