Top level Union is not supported currently; use a subquery for the union : Error

August 1, 2013
select c1, c2 from cert.tset1 tset1 union all select c1, c2 from cert.tset2 


select * from ( select c1, c2 from cert.tset1 tset1 union all select c1, c2 
from cert.tset2 tset2 ) T 


Insert into doesnt work in Hive – by passing it !

August 1, 2013

The insert into command doesnt work in hive and gives the error “mismatched input ‘INTO’ expecting OVERWRITE in insert clause”.

Hence, we have to look at the other methods for implementing the same.
Hive tables are set up to be partitioned and load/insert overwrite partitions at a time.

There is another inefficient method of doing this :

SELECT * from myTable;

5 reasons to use the hadoop-eclipse plugin

May 6, 2013
  1. You can browse the hdfs 
  2. You can create new users in the hdfs
  3. You can upload files from your local development machine to the HDFS directly using the plugin and no commandline
  4. Creating a MapReduce Project instead of a generic Java project automatically adds the prerequisite jar files to the build path. If you create a regular Java project, you must add the Hadoop jar (and its dependencies) to the build path manually.
  5. An easier way to manipulate files in HDFS may be through the Eclipse plugin. In the DFS location viewer, right-click on any folder to see a list of actions available. You can create new subdirectories, upload individual files or whole subdirectories, or download files and directories to the local disk.

How to create a directory on the hadoop filesystem ?

May 3, 2013

hadoop dfs -fs hdfs://<url>:<port> -mkdir <directory_name>

How to copy files from one Hadoop Cluster to another ?

May 1, 2013

DistCp (distributed copy) is a tool used for large inter/intra-cluster copying. It uses Map/Reduce to effect its distribution, error handling and recovery, and reporting.

bash$ hadoop distcp hdfs://nn1:8020/foo/bar \

Reference :

To Do : read all multi source copy of distcp and publish a blog on it

Read all the other command guide from here

Read the whole of hadoop from YDN and blog about the same

Think about all of them in question format and write them down.

How can you specify the Hadoop Filesystem

May 1, 2013

-fs [local | <file system URI>]: Specify the file system to use.
If not specified, the current configuration is used,
taken from the following, in increasing precedence:
core-default.xml inside the hadoop jar file
core-site.xml in $HADOOP_CONF_DIR
‘local’ means use the local file system as your DFS.
<file system URI> specifies a particular file system to
contact. This argument is optional but if used must appear
appear first on the command line. Exactly one additional
argument must be specified.

To get clarity in understanding, you should realize that hadoop is using a distributed filesystem on a cluster. So, even if you are pointing to one url, there are a lot of nodes behind that url in the cluster. As a hadoop user, you are agnostic of hadoop is maintaining these nodes or how the hadoop operations are running on these nodes. So basically, when you do a distcp, that is copy data from one cluster to another, you basically copy data from one distributed hadoop filesystem to another distributed hadoop filesystem.

Hadoop commands cheat sheet

April 30, 2013
  1. %hadoop namenode -format     #This will format the file system
  2. starting the daemons :  ;
  3. If the configuration files, mentioned in the previous post are in a separate directory run the commands with the –config option : –config path-to-config-directory
  4. This will start a namenode, a secondary namenode and a datanode
  5. Commands to close the daemons : and
  6. sd
  7. sd

You should also read up and then write a post like how the developer machine works and then how the developer machine can connect and run jobs on the hadoop cluster, etc. Then how he can deploy the code, or test the code from his developer machine while development with the hadoop cluster and then how does it changed when the code gets deployed.