Hi,
I am new bee to hive and trying to understand the hive partitioning .
My files are in CSV format
Steps which I followed
CREATE EXTERNAL TABLE IF NOT EXISTS loan_depo_part(COLUMN1 String ,COLUMN2
String ,COLUMN3 String ,
COLUMN4 String,COLUMN5
String,COLUMN6 String,
COLUMN7 Int ,COLUMN8 Int
,COLUMN9 String ,
COLUMN10 String ,COLUMN11
String ,COLUMN12 String,
COLUMN13 String ,COLUMN14
String ,
COLUMN15 String ,COLUMN16
String ,
COLUMN17 String ,COLUMN18
String ,
COLUMN19 String ,COLUMN20
String ,
COLUMN21 String ,COLUMN22
String )
COMMENT 'testing Partition'
PARTITIONED BY (Year String,Month String ,Day String)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
STORED AS TEXTFILE
TBLPROPERTIES ("skip.header.line.count"="1") ;
ALTER TABLE loan_depo_part ADD IF NOT EXISTS PARTITION(
Year=2015,Month=01,Day=01);
ALTER TABLE loan_depo_part PARTITION(Year=2015,Month=01,Day=01)
SET LOCATION
'hdfs://namenode:8020/tmp/TestDivya/HiveInput/year=2015/month=01/day=01/';
Whereas my HDFS data location is
/TestDivya/HiveInput/year=2015/month=01/day=01/
I have few queries regarding the above partioning :
1. It creates the table when run the second step and gives the select
command it doesnt diplay any data
2. Do I need to create normal external table first and the partitioned one
next
and then do the insert overwrite.
Basically I am not able to understand the partioning things mentioned above
I followed this link
<http://deanwampler.github.io/polyglotprogramming/papers/Hive-SQLforHadoop.pdf>
Would really appreciate the help/pointers.
Thanks,
Divya