Hive - Parquet

> Database > Apache - Hive (HS|Hive Server)

1 - About

Table - Parquet Format (On Disk) in Hive

Supported natively in Hive 0.13 and later.

Advertising

3 - Example

CREATE TABLE parquet_test (
 id INT,
 str string,
 mp MAP<STRING,STRING>,
 lst ARRAY<STRING>,
 strct STRUCT<A:STRING,B:STRING>) 
PARTITIONED BY (part string)
STORED AS PARQUET;
  • Wifi data table
CREATE EXTERNAL TABLE `inhome_Wifi`(
  `attrvaluestring` string, 
  `polling_timestamp` TIMESTAMP, 
  `modemtype` string, 
  `modemmac` string, 
  `oid` string, 
  `mib_index` INT, 
  `assdevindex` INT, 
  `attrvalueinteger` INT, 
  `attrvaluefloat` FLOAT)
PARTITIONED BY ( 
  `partitioning_year` INT, 
  `partitioning_month` INT, 
  `partitioning_day` INT)
ROW FORMAT SERDE 
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION
  'maprfs:/production/inhome_wifi/inhome_wifi'
TBLPROPERTIES (
  'last_modified_by'='mapr', 
  'last_modified_time'='1512370733', 
  'transient_lastDdlTime'='1512370733')

4 - Documentation / Reference

db/hive/parquet.txt · Last modified: 2019/05/14 12:34 by gerardnico