[jira] [Commented] (FLINK-2621) Add support for positional arguments to ParameterTool

2021-04-22 Thread Flink Jira Bot (Jira)


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

Flink Jira Bot commented on FLINK-2621:
---

This major issue is unassigned and itself and all of its Sub-Tasks have not 
been updated for 30 days. So, it has been labeled "stale-major". If this ticket 
is indeed "major", please either assign yourself or give an update. Afterwards, 
please remove the label. In 7 days the issue will be deprioritized.

> Add support for positional arguments to ParameterTool
> -
>
> Key: FLINK-2621
> URL: https://issues.apache.org/jira/browse/FLINK-2621
> Project: Flink
>  Issue Type: Sub-task
>  Components: flink-contrib
>Reporter: Behrouz Derakhshan
>Priority: Major
>  Labels: stale-major
> Fix For: 0.9
>
>
> While working on FLINK-2021, we noticed we need to have support for 
> positional arguments, since after FLINK-2021 is merged, all training 
> materials and guides that are pointing to the old way of executing the 
> examples will not work. 
> What I have in mind is something like this:
> {code}
> // -- Constructors 
>   public static ParameterTool fromArgs(String[] args) {
>   isPositional = true;
>   // check if arg type is positional
>   for(String arg:args){
>   if (arg.contains("--")){
>   isPositional = false;
>   }
>   }
>   if(isPositional){
>   return fromPositionalArgument(args);
>   }
>   ...
>   // create ParameterTool for positional arguments
>   public static ParameterTool fromPositionalArgument(String[] args){
>   return new ParameterTool(args);
>   }
>   ...
>   // underlying storage for arguments 
>   private String[] dataPositional;
>   private ParameterTool(String[] args){
>   this.dataPositional = args;
>   }
>   // return the positional argument based on the given index
>   public String get(int position){
>   if(!isPositional){
>   throw new RuntimeException("Arguments are of type of 
> key, value");
>   }
>   return dataPositional[position];
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (FLINK-2621) Add support for positional arguments to ParameterTool

2015-09-04 Thread Robert Metzger (JIRA)

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

Robert Metzger commented on FLINK-2621:
---

I wrote on the ML again.
I would prefer to have support by the majority of the committers here before we 
are changing all the examples. Otherwise, the discussion will start when you're 
opening the pull request. In the worst case, the work could be in vain.

> Add support for positional arguments to ParameterTool
> -
>
> Key: FLINK-2621
> URL: https://issues.apache.org/jira/browse/FLINK-2621
> Project: Flink
>  Issue Type: Sub-task
>  Components: flink-contrib
>Reporter: Behrouz Derakhshan
> Fix For: 0.9
>
>
> While working on FLINK-2021, we noticed we need to have support for 
> positional arguments, since after FLINK-2021 is merged, all training 
> materials and guides that are pointing to the old way of executing the 
> examples will not work. 
> What I have in mind is something like this:
> {code}
> // -- Constructors 
>   public static ParameterTool fromArgs(String[] args) {
>   isPositional = true;
>   // check if arg type is positional
>   for(String arg:args){
>   if (arg.contains("--")){
>   isPositional = false;
>   }
>   }
>   if(isPositional){
>   return fromPositionalArgument(args);
>   }
>   ...
>   // create ParameterTool for positional arguments
>   public static ParameterTool fromPositionalArgument(String[] args){
>   return new ParameterTool(args);
>   }
>   ...
>   // underlying storage for arguments 
>   private String[] dataPositional;
>   private ParameterTool(String[] args){
>   this.dataPositional = args;
>   }
>   // return the positional argument based on the given index
>   public String get(int position){
>   if(!isPositional){
>   throw new RuntimeException("Arguments are of type of 
> key, value");
>   }
>   return dataPositional[position];
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-2621) Add support for positional arguments to ParameterTool

2015-09-04 Thread Behrouz Derakhshan (JIRA)

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

Behrouz Derakhshan commented on FLINK-2621:
---

Well I had the idea of users not being concern with whether it is positional or 
key/value. But now that I'm thinking about it, support for key/value and/or 
positional have to be explicitly provided when a new main method is being 
written. 

But still to resolve this FLINK-2021, somehow we need to figure out if the 
arguments to the examples are positional or key/value, how do you propose to do 
that? 

> Add support for positional arguments to ParameterTool
> -
>
> Key: FLINK-2621
> URL: https://issues.apache.org/jira/browse/FLINK-2621
> Project: Flink
>  Issue Type: Sub-task
>  Components: flink-contrib
>Reporter: Behrouz Derakhshan
> Fix For: 0.9
>
>
> While working on FLINK-2021, we noticed we need to have support for 
> positional arguments, since after FLINK-2021 is merged, all training 
> materials and guides that are pointing to the old way of executing the 
> examples will not work. 
> What I have in mind is something like this:
> {code}
> // -- Constructors 
>   public static ParameterTool fromArgs(String[] args) {
>   isPositional = true;
>   // check if arg type is positional
>   for(String arg:args){
>   if (arg.contains("--")){
>   isPositional = false;
>   }
>   }
>   if(isPositional){
>   return fromPositionalArgument(args);
>   }
>   ...
>   // create ParameterTool for positional arguments
>   public static ParameterTool fromPositionalArgument(String[] args){
>   return new ParameterTool(args);
>   }
>   ...
>   // underlying storage for arguments 
>   private String[] dataPositional;
>   private ParameterTool(String[] args){
>   this.dataPositional = args;
>   }
>   // return the positional argument based on the given index
>   public String get(int position){
>   if(!isPositional){
>   throw new RuntimeException("Arguments are of type of 
> key, value");
>   }
>   return dataPositional[position];
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (FLINK-2621) Add support for positional arguments to ParameterTool

2015-09-04 Thread Robert Metzger (JIRA)

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

Robert Metzger commented on FLINK-2621:
---

Looks good. I think that the check for conditional arguments 
{{arg.contains("--")}} is a bit too weak. 

Why aren't you adding a `fromPositionalArgs()` static method?

> Add support for positional arguments to ParameterTool
> -
>
> Key: FLINK-2621
> URL: https://issues.apache.org/jira/browse/FLINK-2621
> Project: Flink
>  Issue Type: Sub-task
>  Components: flink-contrib
>Reporter: Behrouz Derakhshan
> Fix For: 0.9
>
>
> While working on FLINK-2021, we noticed we need to have support for 
> positional arguments, since after FLINK-2021 is merged, all training 
> materials and guides that are pointing to the old way of executing the 
> examples will not work. 
> What I have in mind is something like this:
> {code}
> // -- Constructors 
>   public static ParameterTool fromArgs(String[] args) {
>   isPositional = true;
>   // check if arg type is positional
>   for(String arg:args){
>   if (arg.contains("--")){
>   isPositional = false;
>   }
>   }
>   if(isPositional){
>   return fromPositionalArgument(args);
>   }
>   ...
>   // create ParameterTool for positional arguments
>   public static ParameterTool fromPositionalArgument(String[] args){
>   return new ParameterTool(args);
>   }
>   ...
>   // underlying storage for arguments 
>   private String[] dataPositional;
>   private ParameterTool(String[] args){
>   this.dataPositional = args;
>   }
>   // return the positional argument based on the given index
>   public String get(int position){
>   if(!isPositional){
>   throw new RuntimeException("Arguments are of type of 
> key, value");
>   }
>   return dataPositional[position];
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)