Search This Blog

How to create Hive table for Parquet data format file ?

In this article we will learn How to create Hive table for parquet file format data. We  need to use stored as Parquet  to create a hive table for Parquet file  format data.


1) Create  hive table without location.

We can create hive table for Parquet data without location.  And we can load data into that table later.

Command :

create table employee_parquet(name string,salary int,deptno int,DOJ date)  row format delimited fields terminated by ',' stored as Parquet ;




2) Load data into hive table .

We can use regular insert query to load data into parquet file format table. Data will be converted into parquet file format implicitely while loading the data.

 insert into table employee_parquet select * from employee;



3) Create hive table with location

We can  also create hive table for parquet file data  with location. Specified location should have parquet file format data.

Command :

create table employee_parquet(name string,salary int,deptno int,DOJ date)  row format delimited fields terminated by ',' 
stored as parquet location '/data/in/employee_parquet' ;



38 comments:

  1. This post is so helpful. Thanks for sharing this one. aaafencedeck.com

    ReplyDelete
  2. Thanks for the great content! soundproof plastering

    ReplyDelete
  3. In today's dynamic financial landscape, individuals seek innovative avenues to bolster their investment portfolios and secure their financial futures. iTrustCapital Login emerges as a beacon, revolutionizing the traditional investment paradigm by offering a seamless platform for self-directed retirement accounts focused on digital assets like cryptocurrencies and precious metals.

    ReplyDelete
  4. This post is incredibly informative! Your step-by-step guide on creating a Hive table for Parquet files is clear and easy to follow. I appreciate the practical tips and examples you provided. Thank you for sharing your expertise—looking forward to more helpful content! Kalanruoto

    ReplyDelete