简体   繁体   中英

How to convert PCollection of Strings to TableRows?

I'm trying a to create a very simple Beam pipeline that takes a PubSub message and writes it to BigQuery. The message comes in as a string, and I need to convert it to a TableRow to write it to BigQuery. I, for the life of me, can't find an easy way to do that. My table is just a single column at this point. Any recommendations?

Take a look at the example in the javadoc of BigQueryIO.write() .

The syntax is: new TableRow().set("columnName", value).set("otherColumn", value) etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM