Skip to content

Commit

Permalink
CLean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Jun 18, 2024
1 parent ecd459e commit 7c75641
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion clients/bigquery/bigquery.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func (s *Store) putTableViaStorageWriteAPI(ctx context.Context, bqTableID TableI
managedwriter.WithDestinationTable(
managedwriter.TableParentFromParts(bqTableID.ProjectID(), bqTableID.Dataset(), bqTableID.Table()),
),
managedwriter.WithType(managedwriter.DefaultStream),
managedwriter.WithType(managedwriter.PendingStream),
managedwriter.WithSchemaDescriptor(schemaDescriptor),
managedwriter.EnableWriteRetries(true),
)
Expand Down Expand Up @@ -177,6 +177,10 @@ func (s *Store) putTableViaStorageWriteAPI(ctx context.Context, bqTableID TableI
}
}

if _, err = managedStream.Finalize(ctx); err != nil {
return fmt.Errorf("error during Finalize: %w", err)
}

req := &storagepb.BatchCommitWriteStreamsRequest{
Parent: managedwriter.TableParentFromStreamName(managedStream.StreamName()),
WriteStreams: []string{managedStream.StreamName()},
Expand Down

0 comments on commit 7c75641

Please sign in to comment.