Javatpoint Logo
Javatpoint Logo

Dynamic Partitioning

In dynamic partitioning, the values of partitioned columns exist within the table. So, it is not required to pass the values of partitioned columns manually.

  • First, select the database in which we want to create a table.

Dynamic Partitioning
  • Enable the dynamic partition by using the following commands: -
  • Create a dummy table to store the data.

Dynamic Partitioning
  • Now, load the data into the table.

Dynamic Partitioning
  • Create a partition table by using the following command: -

Dynamic Partitioning
  • Now, insert the data of dummy table into the partition table.

Dynamic Partitioning
Dynamic Partitioning
  • In the following screenshot, we can see that the table student_part is divided into two categories.
Dynamic Partitioning
  • Let's retrieve the entire data of the table by using the following command: -

Dynamic Partitioning
  • Now, try to retrieve the data based on partitioned columns by using the following command: -

Dynamic Partitioning

In this case, we are not examining the entire data. Hence, this approach improves query response time.

  • Let's also retrieve the data of another partitioned dataset by using the following command: -

Dynamic Partitioning
Next TopicBucketing in Hive





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA