Parquet 笔记

90 篇文章 1 订阅
1 篇文章 0 订阅

Glossary (术语)

Block (hdfs block): This means a block in hdfs and the meaning is unchanged for describing this file format. The file format is designed to work well on top of hdfs.

File: A hdfs file that must include the metadata for the file. It does not need to actually contain the data.

Row group: A logical horizontal partitioning of the data into rows. There is no physical structure that is guaranteed for a row group. A row group consists of a column chunk for each column in the dataset.

Column chunk: A chunk of the data for a particular column. These live in a particular row group and is guaranteed to be contiguous in the file.

Page: Column chunks are divided up into pages. A page is conceptually an indivisible unit (in terms of compression and encoding). There can be multiple page types which is interleaved in a column chunk.

Hierarchically, a file consists of one or more row groups. A row group contains exactly one column chunk per column. Column chunks contain one or more pages.

parquet-tools

可参考 http://blog.51yip.com/hadoop/2322.html

parquet 1.10.0 版本里有 tools

wget https://github.com/apache/parquet-mr/archive/apache-parquet-1.10.0.tar.gz
tar zxvf  apache-parquet-1.10.0.tar.gz
cd parquet-mr-apache-parquet-1.10.0/parquet-tools && mvn clean package -Plocal

mvn编译时加上了-Plocal,这样本地用java就可以查看。如果不加,就要用hadoop命令去查看

$ java -jar ./target/parquet-tools-1.10.0.jar schema /home/hadoop/tools/000000_0
message hive_schema {
  optional int64 cc_call_center_sk;
  optional binary cc_call_center_id (UTF8);
  optional int32 cc_rec_start_date (DATE);
  optional int32 cc_rec_end_date (DATE);
  optional int64 cc_closed_date_sk;
  optional int64 cc_open_date_sk;
  optional binary cc_name (UTF8);
  optional binary cc_class (UTF8);
  optional int32 cc_employees;
  optional int32 cc_sq_ft;
  optional binary cc_hours (UTF8);
  optional binary cc_manager (UTF8);
java -jar ./target/parquet-tools-1.10.0.jar meta  /home/hadoop/tools/000000_0
file:              file:/home/hadoop/tools/000000_0 
creator:           parquet-mr version 1.10.0 (build 031a6654009e3b82020012a18434c582bd74c73a) 
extra:             writer.time.zone = Asia/Shanghai 

file schema:       hive_schema 
--------------------------------------------------------------------------------
cc_call_center_sk: OPTIONAL INT64 R:0 D:1
cc_call_center_id: OPTIONAL BINARY O:UTF8 R:0 D:1
cc_rec_start_date: OPTIONAL INT32 O:DATE R:0 D:1
cc_rec_end_date:   OPTIONAL INT32 O:DATE R:0 D:1
cc_closed_date_sk: OPTIONAL INT64 R:0 D:1
cc_open_date_sk:   OPTIONAL INT64 R:0 D:1
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值