약 6 천만 개의 항목 (거의 4.5GB)이 포함 된 큰 시퀀스 파일이 있습니다. 분할하고 싶습니다. 예를 들어, 나는 그것을 3 개의 부분으로 나누고 싶다. 각각은 2 천만 개의 항목을 갖고있다. 지금까지 내 코드는 다음과 같습니다.큰 시퀀스 파일을 여러 시퀀스 파일로 분할하는 방법은 무엇입니까?
//Read from sequence file
JavaPairRDD<IntWritable,VectorWritable> seqVectors = sc.sequenceFile(inputPath, IntWritable.class, VectorWritable.class);
JavaPairRDD<IntWritable,VectorWritable> part=seqVectors.coalesce(3);
part.saveAsHadoopFile(outputPath+File.separator+"output", IntWritable.class, VectorWritable.class, SequenceFileOutputFormat.class);
불행하게도 생성 된 시퀀스 파일은 각각 약 4GB (총 12GB)입니다. 누구나 더 나은/유효한 접근 방식을 제안 할 수 있습니까?
당신이 한 일은 IMHO로가는 길입니다. 파일을 동일한 크기로 만들려면 –
을 병합하지 말고 다시 파티션을 사용하지만 파티션을 다시 지정하면 오류가 발생합니다. -> 17/05/03 23:10:46 오류 executor.Executor : 0.0 단계의 작업 1.0 예외 (TID 1) com.esotericsoftware.kryo.KryoException : java.util.ConcurrentModificationException 직렬화 추적 : 클래스 (sun.misc.Launcher $ AppClassLoader) classLoader가 (org.apache.hadoop.mapred.JobConf) conf의 (org.apache.mahout .mot.VectorWritable) ---- 세부 정보 추적 ---> https://pastebin.com/eDWvV6Fx @TalJoffe – user3086871
문제가 shuffling에 있다고 생각합니다. 왜냐하면 내가 coalesce (3, true) 같은 문제를 사용하기 때문에 던졌습니다! – user3086871