I am following the instructions in the following post to write to a date-partitioned table in BigQuery. I am using a serializable function to map the the window to a partition-location using the $
syntax and I get the following error:
Invalid table ID \"table$19700822\". Table IDs must be alphanumeric (plus underscores) and must be at most 1024 characters long.
Am I missing something here?
Edit adding code:
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
– Narek