我正在按照以下帖子中的说明写入 BigQuery 中的日期分区表。我正在使用可序列化函数使用$
语法将窗口映射到分区位置,但出现以下错误:
Invalid table ID \"table$19700822\". Table IDs must be alphanumeric (plus underscores) and must be at most 1024 characters long.
我在这里错过了什么吗?
编辑添加代码:
p.apply(Window.<TableRow>into(FixedWindows.of(Duration.standardDays(1))))
.apply(BigQueryIO.Write
.named("Write")
.withSchema(schema)
.withWriteDisposition(BigQueryIO.Write.WriteDisposition.WRITE_APPEND)
.withCreateDisposition(BigQueryIO.Write.CreateDisposition.CREATE_IF_NEEDED)
.to(new SerializableFunction<BoundedWindow, String>() {
public String apply(BoundedWindow window) {
String dayString = DateTimeFormat.forPattern("yyyyMMdd")
.withZone(DateTimeZone.UTC)
.print(((IntervalWindow) window).start());
return "project_id:dataset.table$" + dayString;
}
}));