2
我在Java中的Hadoop的工作,其中有序列輸出格式:如何在Java中爲Hadoop作業定義ParquetOutputFormat的parquet模式?
job.setOutputFormatClass(SequenceFileOutputFormat.class);
我想用木地板格式而不是。我試着將它設置在天真的方式:
job.setOutputFormatClass(ParquetOutputFormat.class);
ParquetOutputFormat.setOutputPath(job, output);
ParquetOutputFormat.setCompression(job, CompressionCodecName.GZIP);
ParquetOutputFormat.setCompressOutput(job, true);
但是當談到編寫工作的結果到磁盤中,鮑勃將失敗:
Error: java.lang.NullPointerException: writeSupportClass should not be null
at parquet.Preconditions.checkNotNull(Preconditions.java:38)
at parquet.hadoop.ParquetOutputFormat.getWriteSupport(ParquetOutputFormat.java:326)
看來,是實木複合地板需要一個架構TE設置,但我找不到一本手冊或指南,在我的情況下如何做到這一點。 我的Reducer
類嘗試通過使用org.apache.hadoop.io.LongWritable
作爲關鍵字和作爲值在每行上寫下3個長值。
如何爲此定義模式?