0 votes
in Big Data | Hadoop by
Steps to Make a Partition

Step 1: Create Hive table.

=> create table city(no int,name string) partitioned by (city string) row format delimited fields terminated by ',';

Step 2: Load data into the table.

=>set hive.exec.dynamic.partition.mode=nonstrict;
(as hive is by default set to strict mode)
=>load data local inpath '/home/arani/Desktop/cities.csv' overwrite into table city partition(city="chennai");
=>load data local inpath '/home/arani/Desktop/cities2.csv' overwrite into table city partition(city="mumbai");

Here we are creating two partition(chennai,mumbai).

Step 3: Use a where clause to get the appropriate result.

=>select * from city where city="chennai";

Related questions

0 votes
asked Apr 24, 2020 in Big Data | Hadoop by Hodge
+1 vote
asked May 7, 2020 in Big Data | Hadoop by GeorgeBell
...