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 19 in Big Data Hadoop by disha

edited Jun 19 by Gitika 67 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 19 by Gitika
• 25,340 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 in Big Data Hadoop by Omkar
• 67,380 points
1,573 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
• 27,630 points
144 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
• 67,380 points
1,145 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
• 67,380 points
814 views
0 votes
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
• 10,670 points
2,642 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
• 10,670 points
275 views
0 votes
10 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyFr ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
13,202 views
0 votes
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,240 points
972 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 in Big Data Hadoop by Gitika
• 25,340 points
33 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 in Big Data Hadoop by Gitika
• 25,340 points
33 views