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

Pierre Regazzoni updated KNOX-712:
----------------------------------
    Description: 
Seems like I can't pass multiple argument via knox shell as follow:

```
jobId = Job.submitPig(session) \
  .arg( "-p" ) \
  .arg( "someparam=somevalue" ) \
  .arg( "-v" ) \
...
```

Looking at code looks like Pig code can only take one arg.

Would expect code to be as follow:

```
    public Request arg( String arg ) {
// remove this line:
//      this.arg = arg;
// add this line:
      addParam( params, "arg", value );
      return this;
    }

...

    protected Callable<Response> callable() {
      return new Callable<Response>() {
        @Override
        public Response call() throws Exception {
          URIBuilder uri = uri( Job.SERVICE_PATH, "/pig" );
          List<NameValuePair> params = new ArrayList<NameValuePair>();
          addParam( params, "group", group );
          addParam( params, "file", file );
// remove this line:
//          addParam( params, "arg", arg );
          addParam( params, "statusdir", statusDir );
          UrlEncodedFormEntity form = new UrlEncodedFormEntity( params );
          HttpPost request = new HttpPost( uri.build() );
          request.setEntity( form );
          return new Response( execute( request ) );
        }
      };
    }
```


  was:
Seems like I can't pass multiple argument via knox shell as follow:

jobId = Job.submitPig(session) \
  .arg( "-p" ) \
  .arg( "someparam=somevalue" ) \
  .arg( "-v" ) \
...

Looking at code looks like Pig code can only take one arg.

Would expect code to be as follow:

    public Request arg( String arg ) {
// remove this line:
//      this.arg = arg;
// add this line:
      addParam( params, "arg", value );
      return this;
    }

...

    protected Callable<Response> callable() {
      return new Callable<Response>() {
        @Override
        public Response call() throws Exception {
          URIBuilder uri = uri( Job.SERVICE_PATH, "/pig" );
          List<NameValuePair> params = new ArrayList<NameValuePair>();
          addParam( params, "group", group );
          addParam( params, "file", file );
// remove this line:
//          addParam( params, "arg", arg );
          addParam( params, "statusdir", statusDir );
          UrlEncodedFormEntity form = new UrlEncodedFormEntity( params );
          HttpPost request = new HttpPost( uri.build() );
          request.setEntity( form );
          return new Response( execute( request ) );
        }
      };
    }




> submitPig does not allow multiple argument via arg()
> ----------------------------------------------------
>
>                 Key: KNOX-712
>                 URL: https://issues.apache.org/jira/browse/KNOX-712
>             Project: Apache Knox
>          Issue Type: Bug
>          Components: ClientDSL
>    Affects Versions: 0.7.0
>            Reporter: Pierre Regazzoni
>
> Seems like I can't pass multiple argument via knox shell as follow:
> ```
> jobId = Job.submitPig(session) \
>   .arg( "-p" ) \
>   .arg( "someparam=somevalue" ) \
>   .arg( "-v" ) \
> ...
> ```
> Looking at code looks like Pig code can only take one arg.
> Would expect code to be as follow:
> ```
>     public Request arg( String arg ) {
> // remove this line:
> //      this.arg = arg;
> // add this line:
>       addParam( params, "arg", value );
>       return this;
>     }
> ...
>     protected Callable<Response> callable() {
>       return new Callable<Response>() {
>         @Override
>         public Response call() throws Exception {
>           URIBuilder uri = uri( Job.SERVICE_PATH, "/pig" );
>           List<NameValuePair> params = new ArrayList<NameValuePair>();
>           addParam( params, "group", group );
>           addParam( params, "file", file );
> // remove this line:
> //          addParam( params, "arg", arg );
>           addParam( params, "statusdir", statusDir );
>           UrlEncodedFormEntity form = new UrlEncodedFormEntity( params );
>           HttpPost request = new HttpPost( uri.build() );
>           request.setEntity( form );
>           return new Response( execute( request ) );
>         }
>       };
>     }
> ```



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

Reply via email to