Skip to content

Commit

Permalink
Adding more logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Dec 17, 2024
1 parent 56ade28 commit cd60907
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion clients/bigquery/bigquery.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,18 @@ func (s *Store) putTable(ctx context.Context, bqTableID dialect.TableIdentifier,
return batch.BySize(tableData.Rows(), maxRequestByteSize, false, encoder, func(chunk [][]byte) error {
result, err := managedStream.AppendRows(ctx, chunk)
if err != nil {
slog.Error("Failed to append rows", slog.Any("err", err))
return fmt.Errorf("failed to append rows: %w", err)
}

resp, err := result.FullResponse(ctx)
if err != nil {
return fmt.Errorf("failed to get response (%s): %w", resp.GetError().String(), err)
slog.Error("Failed to get response", slog.Any("err", err))
return fmt.Errorf("failed to get response: %w", err)
}

if status := resp.GetError(); status != nil {
slog.Error("Failed to append rows", slog.String("status", status.String()))
return fmt.Errorf("failed to append rows: %s", status.String())
}

Expand Down

0 comments on commit cd60907

Please sign in to comment.