How can create the dynamic partition table with data in Hive

0 votes
Can anyone suggest how to create the dynamic partition table with data in Hive?
Jun 20, 2019 in Big Data Hadoop by disha

edited Jun 20, 2019 by Gitika 4,530 views

1 answer to this question.

0 votes

Hi,

We can see some steps to do that:

  • Create a non-partitioned table X and load the data
  • Now create a partitioned table Y and specify the partition column (say state)
  • Load data from X to Y like below

You can use this command to create that:

hive> INSERT INTO TABLE Y PARTITION(state) SELECT * from X;

Here you should ensure that the partition column is the last column of the non-partitioned table.

answered Jun 20, 2019 by Gitika
• 65,890 points

Related Questions In Big Data Hadoop

0 votes
1 answer

How to create a parquet table in hive and store data in it from a hive table?

Please use the code attached below for ...READ MORE

answered Jan 28, 2019 in Big Data Hadoop by Omkar
• 69,230 points
18,558 views
0 votes
1 answer

How to create smaller table from big table in HIVE?

You could probably best use Hive's built-in sampling ...READ MORE

answered Sep 24, 2018 in Big Data Hadoop by digger
• 26,740 points
1,681 views
0 votes
1 answer

How to save Spark dataframe as dynamic partitioned table in Hive?

Hey, you can try something like this: df.write.partitionBy('year', ...READ MORE

answered Nov 6, 2018 in Big Data Hadoop by Omkar
• 69,230 points
8,427 views
0 votes
1 answer

Hadoop Hive: How to skip the first line of csv while loading in hive table?

You can try this: CREATE TABLE temp ...READ MORE

answered Nov 8, 2018 in Big Data Hadoop by Omkar
• 69,230 points
8,847 views
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
10,923 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
2,452 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
108,310 views
–1 vote
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,390 points
4,546 views
0 votes
1 answer

How can we access data with simple SQL knowledge in hive?

Hey, The following examples are simple, common data ...READ MORE

answered May 16, 2019 in Big Data Hadoop by Gitika
• 65,890 points
604 views
0 votes
1 answer

When creating a Hive table how can you specify the table creator name in Hive?

Hey, While creating a table the TBLPROPERTIES clause is used ...READ MORE

answered Jun 26, 2019 in Big Data Hadoop by Gitika
• 65,890 points
1,176 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP