samuob
samuob

Reputation: 31

how does hive create table using parquet and snappy

I know the syntax for creating a table using parquet but I want to know what does this mean to create tables using parquet format and compressed by snappy and how does we do that ? please help me with an example syntax.

What is the advantage by using snappy compression ?

Upvotes: 3

Views: 21130

Answers (3)

chandra kishor
chandra kishor

Reputation: 19

create table info(name string , city string,distance int) row format delimited fields terminated by <terminator> lines terminated by <terminator> stored as PARQUET tblproperties('parquet.compress'='SNAPPY');

Upvotes: 0

Santosh Maddula
Santosh Maddula

Reputation: 171

CREATE TABLE emp(id int, name string, department string, salary float)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
STORED AS PARQUET TBLPROPERTIES ("parquet.compression"="SNAPPY");

Upvotes: 16

jocelyn
jocelyn

Reputation: 898

Snappy has a good tradeoff between compression and CPU. Enabling snappy in parquet files should only be a config of your utility class.

Upvotes: 0

Related Questions