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.

Select color,width from table SORT BY color ASC, width DESC;
  :
1. 1
2. 2
3. Access Mostly Uused Products by 50000+ Subscribers

Correct Answer : Get Lastest Questions and Answer :

Explanation: Mapper produces the output as below

A green,190
A blue,300
A yellow,299
A blue,199
...
As all the key values are same, hence it will go to single reducer, in single reduce() method call.
In the reducer method we will have
One TreeMap java collection, which stored sorted map based on the key. And ArrayList will store all the width of a particular color.
So the TreeMap will be storing the values as below.
blue (199,300)
green (190,199,799)
yellow (299,299)

Now it will iterate over the TreeMap and reverse sort the values stored in the ArrayList. After reverse sorting it emits the output as below.
blue,300
blue,199
green,799
green,199
... As desired output





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 color DESC, width ASC;


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

Correct Answer : Get Lastest Questions and Answer :

Explanation: Mapper emits the following key and value pair

A green,190
A blue,300
A yellow,299
A blue,199
A green,199
A yellow,299
A green,799

In the TreeMap, it stores all the key as color and value part contains all the widths in an ArrayList objects.
As TreeMap already stores the sorted color as key in reverse order as it is instantiated like that only. And
we sort the each instance of the ArrayList in ascending order by iteration on the TreeMap and emit the each color and
width combination which produces the output as belwo.




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 color DESC, width ASC LIMIT 5;

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

Correct Answer : Get Lastest Questions and Answer :

Explanation: Explanation is same as previous question, we limit the output for 5 records, by breaking the loop in the reducer
after 5 iteration.


Related Questions


Question :

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


Question :

Which of the following are the feature of the Apache Hadoop
 :
1. Data Integration
2. Data Processing
3. Access Mostly Uused Products by 50000+ Subscribers
4. All of the above


Question : What are the feature of the Hadoop Framework
 : What are the feature of the Hadoop Framework
1. Nodes talks to each other as little as possible
2. Computation happens where the data is stored
3. Access Mostly Uused Products by 50000+ Subscribers
4. All of the above


Question :

MapTask works at a time....

 :
1. Multiple data blocks
2. Single Blocks
3. Access Mostly Uused Products by 50000+ Subscribers
4. All of the above


Question :

What happens when a running task fails in the hadoop...
 :
1. Failed task data will be lost
2. the master will detect that failure and re-assign the work to a different node on the system
3. Access Mostly Uused Products by 50000+ Subscribers
4. 2 and 3 both are correct


Question :

If a node appears to be running slowly then .....
 :
1. the master can redundantly execute another instance of the same task
2. Result from the first to finish will be used
3. Access Mostly Uused Products by 50000+ Subscribers
4. 1 and 2 are correct