How to load data into Google Cloud Bigtable from Google BigQuery

前端 未结 2 1035
终归单人心
终归单人心 2021-01-20 03:37

I need to populate data into Google Cloud Bigtable and the source of the data will be Google BigQuery.

As an exercise, I am able to read the data from BigQuery and a

相关标签:
2条回答
  • 2021-01-20 03:59

    You can just use the transforms as shown in those examples, adding whatever logic you need in between, for example:

    Pipeline p = Pipeline.create(options);
     .apply(BigQueryIO.Read.from("some_table"))
     .apply(ParDo.of(new DoFn<TableRow, Row>() {
       public void processElement(ProcessContext c) {
         Row output = somehowConvertYourDataToARow(c.element());
         c.output(output);
       }
       })
     .apply(BigtableIO.Write.withTableId("some_other_table");
    
    0 讨论(0)
  • 2021-01-20 04:09

    For a people who want to transform bigquery data to bigtable in future can refer to following link

    Ref : https://github.com/GoogleCloudPlatform/cloud-bigtable-examples/blob/master/java/dataflow-connector-examples/src/main/java/com/google/cloud/bigtable/dataflow/example/BigQueryBigtableTransfer.java

    0 讨论(0)
提交回复
热议问题