Skip to content
This repository was archived by the owner on Nov 11, 2022. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
import com.google.cloud.dataflow.sdk.values.PBegin;
import com.google.cloud.dataflow.sdk.values.PCollection;
import com.google.cloud.dataflow.sdk.values.PCollectionList;
import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;

import org.joda.time.Duration;
Expand Down Expand Up @@ -432,10 +433,14 @@ private static interface Options extends ExamplePubsubTopicOptions, ExampleBigQu
Boolean getOutputToBigQuery();
void setOutputToBigQuery(Boolean value);

@Description("Whether output to Datastoree")
@Description("Whether output to Datastore")
@Default.Boolean(false)
Boolean getOutputToDatastore();
void setOutputToDatastore(Boolean value);

@Description("Datastore output dataset ID, defaults to project ID")
String getOutputDataset();
void setOutputDataset(String value);
}

public static void main(String[] args) throws IOException {
Expand Down Expand Up @@ -477,7 +482,8 @@ public static void main(String[] args) throws IOException {
if (options.getOutputToDatastore()) {
toWrite
.apply(ParDo.named("FormatForDatastore").of(new FormatForDatastore(options.getKind())))
.apply(DatastoreIO.writeTo(options.getProject()));
.apply(DatastoreIO.writeTo(MoreObjects.firstNonNull(
options.getOutputDataset(), options.getProject())));
}
if (options.getOutputToBigQuery()) {
dataflowUtils.setupBigQueryTable();
Expand Down