Reputation: 147
When a Hive query is executed, how many mappers/reducers are executed or When a Hive query is executed, how to identify how man mappers and reducers will get executed ?
Upvotes: 1
Views: 1865
Reputation: 934
Number of Mappers depends on the number of input splits calculated by the jobclient.
And hive query is like series of Map reduce jobs. If you write a simple query like select Count(*) from Employee
only one Map reduce Program will be executed. If you give a complex query which includes lot of aggregations and joins etc, Series of Map Reduce programs will be executed which uses earlier MR phase output as the input to the next MR phase and the final result will be dumped into HDFS.
Number of reducers can be set by developer in Hive Shell as mapred.reduce.tasks=x
Upvotes: 3