0 votes
in Big Data | Hadoop by

How to Achieve?

Step 1: Create a table.

hive>create table table1(id int,firstname string,lastname string) row format delimited fields terminated by ',';

Step 2: Load data into that table.

hive>load data local inpath '/home/arani/Desktop/table1.csv' into table table1; 

Step 3: Now create a bucket table.

 hive>create table bucket_table(id int,firstname string,lastname string) clustered by (id) into 5 buckets row format delimited fields terminated by ',';

Step 4: Insert table created in first step data into the bucket table.

 hive>insert overwrite table bucket_table select * from table1;

Now you can see the bucket table in the UI. Or, you can also see by using this command

hadoopusr$ hdfs dfs -cat /user/hive/warehouse/bucketeddb.db/bucket_table/000000_0 in terminal.

Related questions

0 votes
asked Jan 13, 2020 in Big Data | Hadoop by AdilsonLima
0 votes
asked Apr 7, 2020 in Big Data | Hadoop by GeorgeBell
...