错误包arrowR:“TProtocolException:超出大小限制”-是否可以读取镶木地板文件

问题描述 投票:0回答:1

以下SO中与此错误相关的问题:

Error in `open_dataset()`:
! IOError: Error creating dataset. Could not read schema from 'path/example.parquet'. 
Is this a 'parquet' file?: 
Could not open Parquet input source 'path/example.parquet':
Couldn't deserialize thrift: TProtocolException: Exceeded size limit

我想知道是否有任何方法仍然能够使用 parquet 文件,即使架构因属性而过饱和? 当生成 parquet 文件的脚本被删除,或者需要花费大量时间来询问/提供更干净的 parquet 文件时,就会发生这种情况。

我已经尝试使用分区选项,但无论我使用多少个变量对其进行分区,错误仍然发生。

Repex:

library(arrow)
library(data.table)
# Seed
set.seed(1L)
# Big enough data.table 
dt = data.table(x = sample(1e5L, 1e7L, TRUE), y = runif(100L)) 
# Save in parquet format
write_parquet(dt, "example_ok.parquet")
# Readable
dt_ok <- open_dataset("example_ok.parquet")
# Simple filter 
dt[x == 989L]
# Save in parquet format
write_parquet(dt, "example_error.parquet")
# Error
dt_error <- open_dataset("example_error.parquet")
r parquet apache-arrow
1个回答
0
投票

正如gitlab问题中提到的,添加参数

thrift_string_size_limit
可以读取parquet文件。 请注意,镶木地板文件的大小仍然非常饱和

dt_error <- open_dataset("example_error.parquet", thrift_string_size_limit = 1000000000)
© www.soinside.com 2019 - 2024. All rights reserved.