[ 
https://issues.apache.org/jira/browse/BEAM-4232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17139592#comment-17139592
 ] 

Beam JIRA Bot commented on BEAM-4232:
-------------------------------------

This issue was marked "stale-assigned" and has not received a public comment in 
7 days. It is now automatically unassigned. If you are still working on it, you 
can assign it to yourself again. Please also give an update about the status of 
the work.

> 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
>            Priority: P3
>
>  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)

Reply via email to