我在将json文件转换为镶木地板格式的java程序中使用org.apache.parquet。但是,无论我如何尝试,都无法禁用实木复合地板自己的日志到stdout。
有什么方法可以改变镶木地板的记录水平,或完全将其关闭?

stdout上的日志消息示例...

12-Feb-2017 18:12:21 INFO: org.apache.parquet.hadoop.ColumnChunkPageWriteStore: written 427B for [verb] BINARY: 2,890 values, 385B raw, 390B comp, 1 pages, encodings: [BIT_PACKED, PLAIN_DICTIONARY], dic { 2 entries, 17B raw, 2B comp}
12-Feb-2017 18:12:21 INFO: org.apache.parquet.hadoop.ColumnChunkPageWriteStore: written 3,256B for [postedTime] BINARY: 2,890 values, 3,585B raw, 3,180B comp, 1 pages, encodings: [BIT_PACKED, PLAIN_DICTIONARY], dic { 593 entries, 16,604B raw, 593B comp}
12-Feb-2017 18:12:21 INFO: org.apache.parquet.hadoop.ColumnChunkPageWriteStore: written 4,611B for [message] BINARY: 2,890 values, 4,351B raw, 4,356B comp, 1 pages, encodings: [BIT_PACKED, PLAIN_DICTIONARY], dic { 2,088 entries, 263,329B raw, 2,088B comp}


我如何称呼实木复合地板的示例...

public void writeToParquet(List<GenericData.Record> recordsToWrite, Path fileToWrite) throws IOException {
    try (ParquetWriter<GenericData.Record> writer = AvroParquetWriter
            .<GenericData.Record>builder(fileToWrite)
            .withSchema(SCHEMA)
            .withConf(new Configuration())
            .withCompressionCodec(CompressionCodecName.SNAPPY)
            .build()) {

        for (GenericData.Record record : recordsToWrite) {
            writer.write(record);
        }
    }
}

最佳答案

我知道这是一个古老的问题,但是在CDH 5.x中将Parquet与Hive结合使用时,我刚刚遇到此问题,并且找到了解决方法。看到这里:https://stackoverflow.com/a/45572400/14186

也许其他人会发现它有用。

关于java - 更改 Parquet 的日志级别,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/42191404/

10-10 09:36