Midhun Pottammal
Midhun Pottammal

Reputation: 1149

How Create a hive external table with parquet format

I am trying to create an external table in hive with the following query in HDFS.

CREATE EXTERNAL TABLE `post` (
    FileSK STRING,
    OriginalSK STRING,
    FileStatus STRING,
    TransactionType STRING,
    TransactionDate STRING
   )
  ROW FORMAT DELIMITED
  FIELDS TERMINATED BY ','
  STORED AS PARQUET TBLPROPERTIES("Parquet.compression"="SNAPPY")
  LOCATION 'hdfs://.../post'

getting error

Error while compiling statement: FAILED: ParseException line 11:2 missing EOF at 'LOCATION' near ')'

What is the best way to create a HIVE external table with data stored in parquet format?

Upvotes: 1

Views: 5860

Answers (1)

Midhun Pottammal
Midhun Pottammal

Reputation: 1149

I am able to create table after removing property TBLPROPERTIES("Parquet.compression"="SNAPPY")

CREATE EXTERNAL TABLE `post` (
    FileSK STRING,
    OriginalSK STRING,
    FileStatus STRING,
    TransactionType STRING,
    TransactionDate STRING
   )
  ROW FORMAT DELIMITED
  FIELDS TERMINATED BY ','
  STORED AS PARQUET,
  LOCATION 'hdfs://.../post'

Upvotes: 1

Related Questions