| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0ab2872 commit 84584dc
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -38,6 +38,7 @@ | |||
| 38 | 38 | import com.google.cloud.dataflow.sdk.options.Default; | |
| 39 | 39 | import com.google.cloud.dataflow.sdk.options.Description; | |
| 40 | 40 | import com.google.cloud.dataflow.sdk.options.PipelineOptionsFactory; | |
| 41 | + import com.google.cloud.dataflow.sdk.options.Validation; | ||
| 41 | 42 | import com.google.cloud.dataflow.sdk.runners.DataflowPipelineRunner; | |
| 42 | 43 | import com.google.cloud.dataflow.sdk.transforms.Count; | |
| 43 | 44 | import com.google.cloud.dataflow.sdk.transforms.DoFn; | |
@@ -415,6 +416,7 @@ public void processElement(ProcessContext c) { | |||
| 415 | 416 | */ | |
| 416 | 417 | private static interface Options extends ExamplePubsubTopicOptions, ExampleBigQueryTableOptions { | |
| 417 | 418 | @Description("Input text file") | |
| 419 | + @Validation.Required | ||
| 418 | 420 | String getInputFile(); | |
| 419 | 421 | void setInputFile(String value); | |
| 420 | 422 | ||
@@ -499,7 +501,9 @@ public static void main(String[] args) throws IOException { | |||
| 499 | 501 | .to(tableRef) | |
| 500 | 502 | .withSchema(FormatForBigquery.getSchema()) | |
| 501 | 503 | .withCreateDisposition(BigQueryIO.Write.CreateDisposition.CREATE_IF_NEEDED) | |
| 502 | - .withWriteDisposition(BigQueryIO.Write.WriteDisposition.WRITE_TRUNCATE)); | ||
| 504 | + .withWriteDisposition(options.isStreaming() | ||
| 505 | + ? BigQueryIO.Write.WriteDisposition.WRITE_APPEND | ||
| 506 | + : BigQueryIO.Write.WriteDisposition.WRITE_TRUNCATE)); | ||
| 503 | 507 | } | |
| 504 | 508 | ||
| 505 | 509 | // Run the pipeline. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments