【发布时间】:2019-11-20 05:31:00
【问题描述】:
我是 Dataflow 的新手,如果我的问题很有趣,请原谅我,我正在阅读一个 csv 文件并且它有重复的行,我正在读取这些数据并写入大查询,但是我不想重复数据到我的 BQ 表。
我想到了一种方法,但我不知道如何实现它,它涉及向架构添加某种标志以标记它唯一但我不知道如何
Lists.newArrayList(
new TableFieldSchema()
.setName("person_id")
.setMode("NULLABLE").setType("STRING"),
new TableFieldSchema()
.setName("person_name")
.setMode("NULLABLE")
.setType("STRING") // Cant I add another unique property here?
)
不知道该方法是否可行,但我只需要过滤从转换中检索到的行,例如
PCollection<TableRow> peopleRows =
pipeline
.apply(
"Convert to BiqQuery Table Row",
ParDo.of(new FormatForBigquery())
// Next step to filter duplicates
【问题讨论】:
标签: google-bigquery apache-beam dataflow