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' ;



42 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. Your webpage has taught me a great deal. My improved skills as a door repairman have given me the assurance to say that Atlas Door Repair will reap the benefits. Atlas Door Repair

    ReplyDelete