I created two tables:
1) One for Partitioning with bucketing
2) Only bucketing table
I know the concepts of partitioning and bucketing in hive. But I am little bit confused because I have read that 'partition creates directory and bucketing creates files'. I agree with the first part because I can see that in HDFS Hive Warehouse but I am not able to see any files for the ONLY bucketing table in HDFS except the data file which I loaded into the table. So where are the files of ONLY bucketing table ? The files which I am able to see under partitioned directory is it that one like for eg: 00000_0but this one can be for the partitioned table but what about the other bucketed table ??
Below is my code for creating table:
CREATE TABLE Employee(
ID BIGINT,
NAME STRING,
SALARY BIGINT,
COUNTRY STRING
)
CLUSTERED BY(ID) INTO 5 BUCKETS
ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
STORED AS TEXTFILE;
Code for load data is as below :
load data local inpath '/home/cloudera/Desktop/SampleData.txt' into table employee;
I have read that buckets are created when we create table.Please correct me if I am missing something or going wrong.Anyone help please ?