块和条带有什么区别?

What is the difference between a block and a stripe?

来自 Hive 的文档:

If the table or partition contains many small RCFiles or ORC files, then the above command will merge them into larger files. In case of RCFile the merge happens at block level whereas for ORC files the merge happens at stripe level thereby avoiding the overhead of decompressing and decoding the data.

我的问题是:块状和条状有什么区别?

HDFS blocks是最低层,ORC stripe是上层,这些层是完全独立的,ORC中的stripe不关心下层存储。

HDFS 块:

  • HDFS blocks是最底层的,独立于文件格式。 HDFS 将文件分成块以优化存储。
  • 一个条带可以存储在多个块中,一个块可以包含多个条带或部分条带。 HDFS 会拆分文件,不考虑条带格式或文件格式。
  • HDFS 存储每个文件块元数据,写入和读取文件对于上层 ORC reader 级别是透明的,HDFS 将处理所有块。

兽人条纹:

  • 上层存储。 Stripe 对块一无所知。

  • ORC 可在条带级别拆分。 HDFS 对 ORC 结构以及如何拆分它进行处理一无所知。 HDFS 将文件分成块以优化存储。至少一个条带可以在单个容器中处理。您可以配置条带大小以适合块大小。

一些有用的链接。请阅读以获得更好的理解:

HDFS blocks

HDFS block vs Stripe

ORC optimizing

Big ORC stripes and block padding in S3 - 非常有用的博客