【发布时间】:2016-12-22 05:12:32
【问题描述】:
我正在按照以下 post 中的说明写入 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;
}
}));
【问题讨论】:
-
我不这么认为,因为可序列化函数的输出实际上看起来像:
project-id:dataset.table$YYYYMMDD -
你能提供你正在使用的代码吗?
-
@Sonya 我添加了我正在使用的代码。
标签: google-bigquery google-cloud-dataflow apache-beam