Reputation: 1199
I am new in Hadoop. I try to write a program to get the min and max values per year.The data set looks like:
Product code,Station number,Year,Month,Monthly Precipitation Total (millimetres),Quality
IDCJAC0001,023093,1978,01,4.6,Y
IDCJAC0001,023093,1978,02,11.4,Y
IDCJAC0001,023093,1978,03,4.8,Y
IDCJAC0001,023093,1978,04,46.2,Y
IDCJAC0001,023093,1978,05,52.7,Y
I am using mac and conduct Hadoop on my school cluster. Here is my command line:
hadoop jar hw1-1.0-SNAPSHOT.jar /samplefolder/IDCJAC0001Data1.csv /OUTPUT
But the result shows error:Exception in thread "main" java.lang.ClassNotFoundException: /samplefolder/IDCJAC0001Data1/csv
I've searched on the website and try different commands such as hadoop jar hw1-1.0-SNAPSHOT.jar org.mycompany.hw1.SolarMinMax /samplefolder/IDCJAC0001Data1.csv /OUTPUT
, but the result is same...
Please help me with this problem
Upvotes: 1
Views: 160
Reputation: 5531
You need to run with
hadoop jar hw1-1.0-SNAPSHOT.jar org.mycompany.hw1.SolarMinMax /samplefolder/IDCJAC0001Data1.csv /OUTPUT
and then change your code to be
FileInputFormat.addInputPath(job, new Path(args[1]));
FileOutputFormat.setOutputPath(job, new Path(args[2]));
because args[0]
is the class name.
Upvotes: 1