Hive commands -------------- a) Create external table: hive> CREATE EXTERNAL TABLE LogParserSample( month_name STRING, day STRING, time STRING, host STRING, event STRING, log STRING) PARTITIONED BY(year int, month int) ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.RegexSerDe' WITH SERDEPROPERTIES ( "input.regex" = "(\\w+)\\s+(\\d+)\\s+(\\d+:\\d+:\\d+)\\s+(\\w+\\W*\\w*)\\s+(.*?\\:)\\s+(.*$)" ) stored as textfile; b) Create partitions and load data: [Replace '/user/airawat' with '/user/'] hive> Alter table LogParserSample Add IF NOT EXISTS partition(year=2013, month=04) location '/user/airawat/LogParserSampleHive/logs/airawat-syslog/2013/04/'; hive> Alter table LogParserSample Add IF NOT EXISTS partition(year=2013, month=05) location '/user/airawat/LogParserSampleHive/logs/airawat-syslog/2013/05/';