Skip to content

Instantly share code, notes, and snippets.

@alexvanboxel
Last active June 9, 2017 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexvanboxel/0f38ceb5ccebbccebcd759576be428c2 to your computer and use it in GitHub Desktop.
Save alexvanboxel/0f38ceb5ccebbccebcd759576be428c2 to your computer and use it in GitHub Desktop.
pubsub.apply(Flatten.<TableRow>pCollections())
.apply("Fixed Windows",
Window.<TableRow>into(FixedWindows.of(Duration.standardMinutes(1))))
.apply("BQWrite", BigQueryIO.writeTableRows()
.to(TableRefPartition.perDay(
"my-project",
"my-dataset",
"my-tables"))
.withSchema(SchemaFor.backupEvent())
.withWriteDisposition(BigQueryIO.Write.WriteDisposition.WRITE_APPEND)
.withCreateDisposition(BigQueryIO.Write.CreateDisposition.CREATE_NEVER)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment