【问题标题】:Why do I get the "is not a Parquet file" error when reading a parquet file为什么读取 parquet 文件时出现“不是 Parquet 文件”错误
【发布时间】:2023-03-27 01:56:01
【问题描述】:

从 hdfs 读取 parquet 文件时出现以下错误

2020-06-04 14:11:23 WARN  TaskSetManager:66 - Lost task 44.0 in stage 1.0 (TID 3514, 192.168.16.41, executor 1): java.lang.RuntimeException: hdfs://data-hadoop-hdfs-nn.hadoop:8020/somedata/serviceName=someService/masterAccount=ma/siteAccount=sa/systemCode=111/part-00170-7ff5ac19-98b7-4a5a-b93d-9e988dff07eb.c000.snappy.parquet is not a Parquet file. expected magic number at tail [80, 65, 82, 49] but found [55, 49, 98, 48]

我在互联网上发现了类似的问题,但大多数人都试图阅读除 parquet 之外的其他文件类型。 我 100% 确定该文件是以 parquet 格式编写的,如日志中所示。文件名是 part-00170-7ff5ac19-98b7-4a5a-b93d-9e988dff07eb.c000.snappy.parquet 。

只有一个作业写入此 somdata 文件夹,而这个作业仅写入 parquet(spark 结构化流作业) 结尾还说是拼花文件。 由同一个作业编写的其他 parquet 文件不会抛出此错误

【问题讨论】:

标签: apache-spark hdfs parquet


【解决方案1】:

今天遇到了同样的错误。对我们来说,问题是我们生成的 parquet 文件 > 2GB,这会破坏一些客户端。

https://issues.apache.org/jira/browse/SPARK-24296

设置 spark 选项 maxRecordsPerFile 以限制为我们固定的文件大小。

【讨论】:

    猜你喜欢
    • 2018-12-13
    • 2019-07-26
    • 2021-09-02
    • 1970-01-01
    • 1970-01-01
    • 2020-01-26
    • 1970-01-01
    • 1970-01-01
    • 2019-02-04
    相关资源
    最近更新 更多