After reading data from Bigquery I have to send the data as side Input to next level.So below is the step I am following -
- Read BQ
- Convert PCollection to PCollection<KV<K,V>>
- Converting Pcollection to PcollectionView (Since next step with accept the PcollectionView only as side input)
But Data is not flowing to step 3.Due to this I am not able to send the data in next level where our side Input will go.
Below is the Dataflow -
Below is the code snippet with Java -
PCollection<TableRow> bq_row = pipeline.apply(
"Read from BigQuery query",
BigQueryIO.readTableRows().withoutValidation().withTemplateCompatibility().fromQuery(query).usingStandardSql());
PCollection<KV<String, TableRow>> rowsKeyedByUser = bq_row
.apply(WithKeys.of(new SerializableFunction<TableRow, String>() {
@Override
public String apply(TableRow row) {
return (String) row.get("asset_id");
}
}));
PCollectionView<Map<String, TableRow>> bq_row1 = rowsKeyedByUser.apply(
"viewTags", View.<String, TableRow>asMap());
Please let us know , Is there anything missing from my end ?
