Database Reference
In-Depth Information
count(booktitle) from booksdata group by
yearofpublication;
4. Result of the preceding query:
Pig
The purpose of Pig is similar to Hive with the only difference being that Hive is more
SQL-like interface and is usually used by developers who are familiar and comfort-
able with SQL. For those from a non-SQL background, Pig is an option, where de-
velopers can write Java code that runs as a MapReduce function to query data on
HDFS.
Pig supports many data types and developers can create custom functions in Java,
Python, and JavaScript. Its simple interface eases writing complex joins and other
functions.
Pig can be executed in local or MapReduce mode shown as follows:
$ pig -x local grunt>
OR
$ pig
[main] INFO org.apache.pig.Main - Apache Pig
version 0.10.0 (r1328203) compiled Apr 19 2013,
22:54:12
[main] INFO org.apache.pig.Main - Logging
error messages to: /Users/test/
pig_1351858332488.log
[main] INFO
org.apache.pig.backend.hadoop.executionengine.HExecutionEngine
Search WWH ::




Custom Search