Premium

Cloudera Hadoop Developer Certification Questions and Answer (Dumps and Practice Questions)



Question :
You have following data in a hive table
ID:INT,COLOR:TEXT,WIDTH:INT
1,green,190
2,blue,300
3,yellow,299
4,blue,199
5,green,199
6,yellow,299
7,green,799

Select the correct MapReduce program which can produce the output similar to below
Hive Query(Assuming single reducer).
Select distinct color,width from table;
  :
1. 1
2. 2
3. Access Mostly Uused Products by 50000+ Subscribers
4. 4

Correct Answer : Get Lastest Questions and Answer :
Explanation: In 4th option Mappper emits the values like..
green green,190
blue blue,300
yellow yellow,299
.....
-- In the reducer part, it stores all the combination of color and width in the allColorWidth ArrayList, Hence , allColorWidth will have following values in it.
blue,199
blue,300
green,190
green,199
green,799
....
-- After sorting this ArrayList , it will produce the output as below, for each reduce call
blue,199
blue,300
green,190
.....
--And now iterate over the each elements in the ArrayList to produce the desired output, by comparing width for each color.
blue,199
blue,300
green,190
green,199
green,799




Question : You have following data in a hive table

ID:INT,COLOR:TEXT,WIDTH:INT
1,green,190
2,blue,300
3,yellow,299
4,blue,199
5,green,199
6,yellow,299
7,green,799

Select the correct MapReduce program which can produce the output similar to below Hive Query.
Select color,width from table SORT BY width ASC;

  : You have following data in a hive table
1. 1
2. 2
3. Access Mostly Uused Products by 50000+ Subscribers

Correct Answer : Get Lastest Questions and Answer :

Explanation: In option 1, Mapper produces the output as
A green,190
A blue,300
A yellow,299
A blue,199
...
As all the keys are same , hence single reducer will be called as below. in the reducer method, it creates a new
ArrayList which stores all the combination of color and width as below.
green,190
blue,300
yellow,299
...
After calling Collections.sort(allColorWidth), ArrayList will have values stored as belwo.
blue,199
blue,300
green,190
...
So reducer will emit these as keys, which produces the desired output.s




Question :

You have following data in a hive table

ID:INT,COLOR:TEXT,WIDTH:INT
1,green,190
2,blue,300
3,yellow,299
4,blue,199
5,green,199
6,yellow,299
7,green,799

Select the correct MapReduce program which can produce the output similar to below Hive Query.

Select color,width from table SORT BY width DESC;

  :
1. 1
2. 2
3. Access Mostly Uused Products by 50000+ Subscribers
4. 4

Correct Answer : Get Lastest Questions and Answer :

Explanation: Mapper produces the following output
A 190,green
A 300,blue
A 299,yellow
A 199,blue
A 199,green
A 299,yellow
A 799,green
-- As all the keys are same, hence single reducer will be called. In the reducer we add combination of width and color in the ArrayList and first sort
and then reverse the ArrayList which produce the following results.
799,green
300,blue
299,yellow
299,yellow
199,green
....
-- And iterating over this ArrayList, it will produce the desired output as below.
green,799
blue,300
yellow,299
yellow,299
green,199
blue,199
green,190


Related Questions


Question :

If X and Y are two MapReduce jobs and their dependency is set as below

x.addDependingJob(y)

What does it mean ?
 :
1. X will not start until y has finished
2. Y will not start until x has finished
3. Access Mostly Uused Products by 50000+ Subscribers
4. All of the above




Question :

The option or switch in "hadoop fs" command for detailed help is
 :
1. '-show'
2. '-help'
3. Access Mostly Uused Products by 50000+ Subscribers
4. Any of the above


Question :

Which of the following method or methods of JobControl object can be used to track the execution state of Jobs
 :
1. allFinished()
2. getFailedJobs()
3. Access Mostly Uused Products by 50000+ Subscribers
4. All of the above


Question :

Which class is use to preprocessing and postprocessing of a MapReduce Job
 :
1. ChainMapper
2. ChainReducer
3. Access Mostly Uused Products by 50000+ Subscribers
4. 1 and 2 Both


Question :

Is Data Joining like (RDBMS Join is possible in the Hadoop MapReduce)
 :
1. Yes
2. NO


Question :

Which method of the FileSystem object is used for reading a file in HDFS
 :
1. open()
2. access()
3. Access Mostly Uused Products by 50000+ Subscribers
4. None of the above