【问题标题】:How to read Parquet "group"/list field in cpp?如何在 cpp 中读取 Parquet“组”/列表字段?
【发布时间】:2020-06-01 02:00:48
【问题描述】:

我是 cpp 的新手。我有一些 Parquet,其部分架构如下:

  optional binary one (UTF8);
  optional group two (LIST) {
    repeated group list {
      optional binary element (UTF8);
    }
  }
  optional binary three (UTF8);

我正在使用 Arrow 的 parquet::StreamReader 来阅读它,就像在 this example 中一样。

我很清楚如何读取字段onethree,而one 工作正常,但不是two,所以我无法访问three。对于two,我不确定要使用什么 cpp 类型。我知道logical type is "list" 和下面是将其分配给std::string 的输出只是为了从错误中获取推断的类型,但它向我显示'UNKNOWN'

libc++abi.dylib: terminating with uncaught exception of type parquet::ParquetException: 
Column physical type mismatch.  Column 'two' has physical type 'UNKNOWN' not 'BYTE_ARRAY'

我会完全跳过这个专栏(我不需要它),但我不清楚如何在不解析的情况下做到这一点。

【问题讨论】:

    标签: c++ parquet apache-arrow


    【解决方案1】:

    事实证明,除了基本类型外,不能使用StreamReader。但是,我可以使用StreamReader::SkipColumns 跳过two,然后解析three

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-01-23
      • 1970-01-01
      • 2017-01-16
      • 2015-04-13
      • 2021-03-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多