dhamu
dhamu

Reputation: 695

How to delete rows in a bigquery table using golang

I am trying to delete data from Bigquery table using Google cloud function in golang. I have been successful with insertion , but unable to do delete. Based on some docs and googling, I understand I need to use DML, but not sure how do I actually write the code to perform delete operation. Golang client doc is not very helpful, nor is big query docs when it comes to delete selected rows.

A golang code snippet would be much appreciated. Thanks!

Upvotes: 0

Views: 2197

Answers (1)

shollyman
shollyman

Reputation: 4384

If you want to delete rows, you issue a DML DELETE. More details about the DELETE statement can be found here: https://cloud.google.com/bigquery/docs/reference/standard-sql/dml-syntax#delete_statement

If you want an example of issuing a query, you can see the examples embedded elsewhere in the BigQuery documentation, or just go directly to source code snippets e.g. https://github.com/GoogleCloudPlatform/golang-samples/blob/master/bigquery/snippets/querying/bigquery_query.go

If that's not sufficient, please clarify your question to provide more details about the issue you're experiencing (for example, the schema of your table and what you're trying to delete).

Upvotes: 1

Related Questions