1
我在將json文件轉換爲實木複合格式的java程序中使用了org.apache.parquet。然而,無論我嘗試什麼,我都無法禁用parquet自己的日誌記錄到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);
}
}
}