Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bigquery: Grpc storage api #4033

Closed
gauravgola96 opened this issue May 2, 2021 · 4 comments
Closed

bigquery: Grpc storage api #4033

gauravgola96 opened this issue May 2, 2021 · 4 comments
Assignees
Labels
api: bigquery Issues related to the BigQuery API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@gauravgola96
Copy link

I was trying out https://github.com/googleapis/google-cloud-go/blob/bigquery/v1.17.0/bigquery/storage/apiv1beta2/big_query_write_client_example_test.go

I am unable to figure out to send a nested json into stream.
My use case is where i want to read from db and stream it to big query.
go func() { reqs := []*storagepb.AppendRowsRequest{ // TODO: Create requests. } for _, req := range reqs { if err := stream.Send(req); err != nil { // TODO: Handle error. } } stream.CloseSend() }()
Can somebody plz give an example of requests.

@codyoss codyoss changed the title Grpc storage api: bigquery bigquery: Grpc storage api May 3, 2021
@codyoss codyoss added api: bigquery Issues related to the BigQuery API. triage me I really want to be triaged. labels May 3, 2021
@shollyman
Copy link
Contributor

I've got some work pending here to make this a bit easier, but the API works based on proto serialization, rather than json serialization directly. Will hold onto this until we have examples published.

@shollyman shollyman added priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed triage me I really want to be triaged. labels May 3, 2021
@gauravgola96
Copy link
Author

@shollyman

     import( 	
     storagepb "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1alpha2", 
     storage "cloud.google.com/go/bigquery/storage/apiv1alpha2",
     "context",
     "fmt"
     )


      bqWrite, err := storage.NewBigQueryWriteClient(context.Background()) 
      stream := &storagepb.WriteStream{
		      Type:        storagepb.WriteStream_COMMITTED,
	      }

	req := &storagepb.CreateWriteStreamRequest{
		Parent: "projects/***/datasets/****/tables/****",
		WriteStream: stream,
	}

	resp, err1 := bqWrite.CreateWriteStream(context.Background(), req)

	if err != nil {
		fmt.Print(err)
		return nil,err
	}
	
Getting error : 
`"rpc error: code = Unimplemented desc = Operation is not implemented, or supported, or enabled.`

@shollyman
Copy link
Contributor

The write client is live in apiv1beta2, apiv1alpha2 is turned down.

@shollyman
Copy link
Contributor

Closing this. Also, #4366 may be valuable for following the progress of a veneer over the new write client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the BigQuery API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

3 participants