试图将 Spark 1.6.X Parquet 读入 Spark 的警告 2.X

Warnings trying to read Spark 1.6.X Parquet into Spark 2.X

尝试将 spark 1.6.X parquet 文件加载到 spark 中时 2.X 我看到许多 WARN 级语句。

  16/08/11 12:18:51 WARN CorruptStatistics: Ignoring statistics because created_by could not be parsed (see PARQUET-251): parquet-mr version 1.6.0
  org.apache.parquet.VersionParser$VersionParseException: Could not parse created_by: parquet-mr version 1.6.0 using format: (.+) version ((.*) )?\(build ?(.*)\)
    at org.apache.parquet.VersionParser.parse(VersionParser.java:112)
    at org.apache.parquet.CorruptStatistics.shouldIgnoreStatistics(CorruptStatistics.java:60)
    at org.apache.parquet.format.converter.ParquetMetadataConverter.fromParquetStatistics(ParquetMetadataConverter.java:263)
    at org.apache.parquet.format.converter.ParquetMetadataConverter.fromParquetMetadata(ParquetMetadataConverter.java:567)
    at org.apache.parquet.format.converter.ParquetMetadataConverter.readParquetMetadata(ParquetMetadataConverter.java:544)
    at org.apache.parquet.hadoop.ParquetFileReader.readFooter(ParquetFileReader.java:431)
    at org.apache.parquet.hadoop.ParquetFileReader.readFooter(ParquetFileReader.java:386)
    at org.apache.spark.sql.execution.datasources.parquet.SpecificParquetRecordReaderBase.initialize(SpecificParquetRecordReaderBase.java:107)
    at org.apache.spark.sql.execution.datasources.parquet.VectorizedParquetRecordReader.initialize(VectorizedParquetRecordReader.java:109)
    at org.apache.spark.sql.execution.datasources.parquet.ParquetFileFormat$$anonfun$buildReader.apply(ParquetFileFormat.scala:369)
    at org.apache.spark.sql.execution.datasources.parquet.ParquetFileFormat$$anonfun$buildReader.apply(ParquetFileFormat.scala:343)
    at [rest of stacktrace omitted]

我是 运行 2.1.0 版本,有很多这样的警告。有什么办法 - 除了将日志记录级别更改为 ERROR - 来抑制这些吗?

这些似乎是修复后的结果 - 但警告可能尚未删除。以下是该 JIRA 的一些详细信息:

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

I have built the code from the PR and it indeed succeeds reading the data. I have tried doing df.count() and now I'm swarmed with warnings like this (they are just keep getting printed endlessly in the terminal):

将日志记录级别设置为 ERROR 是最后的方法:它吞噬了我们用于标准监控的消息。有没有人找到解决方法?

目前 - 即 until/unless 这个 spark/parquet 错误已修复 - 我将在 log4j.properties 中添加以下内容:

log4j.logger.org.apache.parquet=ERROR   

地点是:

  • 当 运行 针对外部 spark 服务器时:$SPARK_HOME/conf/log4j.properties

  • 当 运行 本地位于 Intellij(或其他 IDE)内时:src/main/resources/log4j.properties