Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid argument in point-in-polygon-aggregation-mr #17

Closed
trumboosahil opened this issue Nov 16, 2014 · 3 comments
Closed

Invalid argument in point-in-polygon-aggregation-mr #17

trumboosahil opened this issue Nov 16, 2014 · 3 comments

Comments

@trumboosahil
Copy link

I downloaded code from https://github.com/Esri/gis-tools-for-hadoop/tree/master/samples/point-in-polygon-aggregation-mr and after building the jar file I run the example and got an error "Invalid argument" because there is a condition if (args.length != 3) when I ouput the args.length it is 6

As a matter of fact I didn't change anything from source code or shell script

@climbage
Copy link
Member

I assume you used run-sample.sh to run it? Which args did you get?

@trumboosahil
Copy link
Author

Yes I’m using run-sample.sh to run. Here under I’m giving more information

  1. After downloading the sample I found there are some folders containing data, jar file and source code.
  2. I made my own project in eclipse and copied the source code from the downloaded folder and exported jar file . When I use this .jar file it gives error "Invalid argument" because there is a condition if (args.length != 3) when I output the args.length it is 6
  3. When I used the .jar file available in downloaded folder it works fine
  4. The size of my .jar file is is 8.2 KB and .jar file available in downloaded folder is 4.8 KB
  5. I'm using hadoop version
    
    Hadoop 2.3.0-cdh5.1.0
    Subversion git://github.sf.cloudera.com/CDH/cdh.git -r 8e266e052e423af592871e2dfe09d54c03f6a0e8
    Compiled by jenkins on 2014-07-12T13:49Z
    Compiled with protoc 2.5.0

More Information:

I edited the file AggregationSampleDriver as below
<color="red">
String [] args = new GenericOptionsParser(config, init_args).getRemainingArgs();
int size = args.length;
for (int i=0; i<size; i++)
{
System.out.println(String.valueOf(i) + " * " + args[i]);
}

out put on terminal is

<color="blue">
0 * com.esri.hadoop.examples.AggregationSampleDriver
1 * -libjars
2 * ../../lib/esri-geometry-api.jar,../../lib/spatial-sdk-hadoop.jar
3 * hdfs:///user/cloudera/sample/pinp/data/counties-data/california-counties.json
4 * hdfs:///user/cloudera/sample/pinp/data/earthquake-data/earthquakes.csv
5 * hdfs:///user/cloudera/sample/pinp/output

@randallwhitman
Copy link
Contributor

Idea for workaround (like #18):

int argc = args.length;
int expected = 3;
if (argc > expected && AggregationSampleDriver.class.getName().equals(args[0])) {
    for (int ix=0; ix<expected; ++ix) {
        args[ix] = args[ix+argc-expected];  // shift by argc-expected
    }
    argc = expected;  // pretend
}

@climbage climbage closed this as completed Dec 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants