Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Setting write disposition when using the BigQuery Storage API from Node.js

I'm writing data to BigQuery using the Storage Write API using streams in "PENDING" mode, then committing them all at once. Based on previous questions, it seems like setting a write disposition of "WRITE_TRUNCATE" should be possible, but it's throwing a type error for me in both batchCommitWriteStream and createWriteStream. Is there an option or method that I'm missing?

Thanks!

0 1 220
1 REPLY 1

Hi @BlakeH,

Welcome to Google Cloud Community!

You might be using the wrong library version. Try the following steps to address the problem:

  • Verify your library version to ensure you're using the latest version of the BigQuery client library.
  • Check for any typos or syntax errors, as these can impact your API request.
  • Make sure you're using the right classes and methods from the BigQuery client library.

Another option is to manually truncate the table before starting the stream writes, as recommended by @ms4446  in the related Google Cloud Community post.

Review the batch load data process using the Storage Write API, as it includes relevant libraries and documentation for further guidance.

I hope the above information is helpful.