You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "Thomas Groh (JIRA)" <ji...@apache.org> on 2018/06/29 18:34:00 UTC

[jira] [Assigned] (BEAM-4232) ValueProvider with default value fails using DirectRunner

     [ https://issues.apache.org/jira/browse/BEAM-4232?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Groh reassigned BEAM-4232:
---------------------------------

    Assignee: Batkhuyag Batsaikhan  (was: Thomas Groh)

> 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: Minor
>
>  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
(v7.6.3#76005)