Database Reference
In-Depth Information
Table 16-4. Pig Latin commands
Category
Command
Description
Hadoop filesys-
tem
Prints the contents of one or more files
cat
Changes the current directory
cd
copyFromLocal Copies a local file or directory to a Hadoop filesystem
copyToLocal Copies a file or directory on a Hadoop filesystem to the local filesys-
tem
Copies a file or directory to another directory
cp
Accesses Hadoop's filesystem shell
fs
Lists files
ls
Creates a new directory
mkdir
Moves a file or directory to another directory
mv
Prints the path of the current working directory
pwd
Deletes a file or directory
rm
Forcibly deletes a file or directory (does not fail if the file or direct-
ory does not exist)
rmf
Hadoop
MapReduce
Kills a MapReduce job
kill
Utility
Clears the screen in Grunt
clear
Runs a script in a new Grunt shell in batch mode
exec
Shows the available commands and options
help
Prints the query statements run in the current Grunt session
history
quit ( \q )
Exits the interpreter
Runs a script within the existing Grunt shell
run
Sets Pig options and MapReduce job properties
set
Runs a shell command from within Grunt
sh
The filesystem commands can operate on files or directories in any Hadoop filesystem,
and they are very similar to the hadoop fs commands (which is not surprising, as both
are simple wrappers around the Hadoop FileSystem interface). You can access all of
the Hadoop filesystem shell commands using Pig's fs command. For example, fs -ls
will show a file listing, and fs -help will show help on all the available commands.
Search WWH ::




Custom Search