Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating Hive table on top of multiple parquet files in s3

We have our dataset in s3 (parquet files) in the below format, data divided as multiple parquet files based on the row number.

data1_1000000.parquet
data1000001_2000000.parquet
data2000001_3000000.parquet
...

We have more than 2000 such files and each file has million records on it. All these files have same number of columns and structure. And one of the column has timestamp in it if we need to partition the dataset in hive. How can we point the dataset and create a single hive external table on top of it for our analysis or may be use spark for analysing it?

Thanks.

like image 878
ds_user Avatar asked Mar 06 '23 20:03

ds_user


1 Answers

You can simply point to the path containing the files:

CREATE EXTERNAL TABLE parquet_hive (
  foo string
) STORED AS PARQUET
LOCATION 's3://myBucket/myParquet/';
like image 150
John Rotenstein Avatar answered Mar 09 '23 09:03

John Rotenstein