[
https://issues.apache.org/jira/browse/BEAM-4232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17132228#comment-17132228
]
Beam JIRA Bot commented on BEAM-4232:
-------------------------------------
This issue is assigned but has not received an update in 30 days so it has been
labeled "stale-assigned". If you are still working on the issue, please give an
update and remove the label. If you are no longer working on the issue, please
unassign so someone else may work on it. In 7 days the issue will be
automatically unassigned.
> ValueProvider with default value fails using DirectRunner
> ---------------------------------------------------------
>
> Key: BEAM-4232
> URL: https://issues.apache.org/jira/browse/BEAM-4232
> Project: Beam
> Issue Type: Bug
> Components: runner-dataflow
> Reporter: Frank Yellin
> Assignee: Batkhuyag Batsaikhan
> Priority: P3
> Labels: stale-assigned
>
> The bug is shown by the following short piece of code.
> {code:java}
> public class ShowProblem implements Serializable {
> public interface MyOptions
> extends PipelineOptions, DataflowPipelineOptions {
> @Description("OutputFile")
> @Default.String("gs://xyzzy/helloWorld")
> ValueProvider<String> getOutput();
> void setOutput(ValueProvider<String> value);
> }
> public static void main(String args[]) {
> MyOptions options = PipelineOptionsFactory.fromArgs(args)
> .as(MyOptions.class);
> Pipeline pipeline = Pipeline.create(options);
> pipeline
> .apply(Create.of("hello", "world", "!"))
> .apply(TextIO.write().to(options.getOutput()));
> pipeline.run();
> }
> }
> {code}
> If this pipeline is run with the "–output=gs://xyzzy/myfile" option, it runs
> fine both locally and on Google. If this pipeline is run without the
> --option, it runs fine on Google, but fails when run locally.
> When given an output argument, the ValueProvider returned by getOutput() is a
> StaticValueProvider; when using the default value returns a
> RuntimeValueProvider, The latter seems to have a bug hinted at in the
> comment just above RuntimeValueProvider.get(). The code expects that when
> running the pipeline (and only when running the pipeline), someone has
> already called
> {code:java}
> RuntimeValueProvider.setRuntimeOptions(options){code}
> There is apparently no call to this method when using a DirectRunner.
>
>
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)