Professional Documents
Culture Documents
Bda Lab Record Final ( (18071a0591) )
Bda Lab Record Final ( (18071a0591) )
Bda Lab Record Final ( (18071a0591) )
Practical Record
On
BIG DATA ANALYTICS LABORATORY (18PC2CS06)
Submitted to
VNR Vignana Jyothi Institute of
Engineering & Technology
An autonomous Institute – NAAC ‘A++’ and
NBA Accredited
Bachelor of Technology
In
Computer Science & Engineering
(B Tech IV Year I sem)
Submitted By
Student Name: MD ABDUL RAB
Roll No: 18071A0591
VNR VignanaJyothi Institute of Engineering & Technology
Bachupally,Nizampet(S,O) ,Hyderabad-90
CERTIFICATE
Certified that this is the bonafide record of the practical work done during the academic
Date of Exam……………………..
ROLLNO: …………………18071A0591………………..…………………………………………………………………………..
10
11
12
PROGRAM TITLE:
Problem statement:
(method 2)
.
.
.
PROGRAM TITLE:
Problem statement:
package word;
importjava.io.IOException;
importjava.util.StringTokenizer;
importorg.apache.hadoop.io.IntWritable;
importorg.apache.hadoop.io.LongWritable;
importorg.apache.hadoop.io.Text;
importorg.apache.hadoop.mapreduce.Mapper;
importorg.apache.hadoop.mapreduce.Reducer;
importorg.apache.hadoop.conf.Configuration;
importorg.apache.hadoop.mapreduce.Job;
importorg.apache.hadoop.mapreduce.lib.input.TextInputFormat;
importorg.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
importorg.apache.hadoop.mapreduce.lib.input.FileInputFormat;
importorg.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
importorg.apache.hadoop.fs.Path;
publicclassClassword
{
publicstaticclass Map extends Mapper<LongWritable,Text,Text,IntWritable>
{
publicvoid map(LongWritable key, Text value,Context context)
throwsIOException,InterruptedException{
String line = value.toString();
StringTokenizertokenizer = newStringTokenizer(line);
while (tokenizer.hasMoreTokens()) {
value.set(tokenizer.nextToken());
context.write(value, newIntWritable(1));
}
}
}
@SuppressWarnings("deprecation")
publicstaticvoid main(String[] args) throws Exception {
Configurationconf= newConfiguration();
Job job = new Job(conf,"My Word Count Program");
job.setJarByClass(Classword.class); //here put your class name
job.setMapperClass(Map.class);
job.setReducerClass(Reduce.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(IntWritable.class);
job.setInputFormatClass(TextInputFormat.class);
job.setOutputFormatClass(TextOutputFormat.class);
Path outputPath = new Path(args[1]);
//Configuring the input/output path from the filesystem into the job
FileInputFormat.addInputPath(job, new Path(args[0]));
FileOutputFormat.setOutputPath(job, new Path(args[1]));
//deleting the output path automatically from hdfs so that we don't have
to delete it explicitly
outputPath.getFileSystem(conf).delete(outputPath);
//exiting the job only if the flag value becomes false
System.exit(job.waitForCompletion(true) ? 0 : 1);
}
}
11. Move text file from local to HDFS and check its contents there
PROGRAM TITLE: Data Processing Tool – Pig (Latin based scripting lang)
Problem statement:
b. For pigfile1-ar.txt
b. For pigfile1-ar.txt
Check in HDFS
Problem statement:
2. Create a database
11. Export the file abc.txt into the abc_table created using SQOOP