Examples of writeTextFile()


Examples of com.cloudera.crunch.Pipeline.writeTextFile()

      }
    }, pairs(ints(), ints()));
   
    PCollection<Pair<Integer, Integer>> sorted = Sort.sortPairs(pairs, by(1, ASCENDING), by(2, DESCENDING));
   
    pipeline.writeTextFile(sorted, "output-sorted");
    pipeline.run();
  }

}
View Full Code Here

Examples of com.cloudera.crunch.Pipeline.writeTextFile()

    PTable<String, Integer> maxTemps = records
      .parallelDo(toYearTempPairsFn(), tableOf(strings(), ints()))
      .groupByKey()
      .combineValues(CombineFn.<String> MAX_INTS());
   
    pipeline.writeTextFile(maxTemps, "output");
    pipeline.run();
  }

  private static DoFn<String, Pair<String, Integer>> toYearTempPairsFn() {
    return new DoFn<String, Pair<String, Integer>>() {
View Full Code Here

Examples of com.cloudera.crunch.Pipeline.writeTextFile()

    }
  }, tableOf(strings(),strings()));
   
    PTable<String, Pair<String, String>> join = Join.join(aTable, bTable);
   
    pipeline.writeTextFile(join, "output-joined");
    pipeline.run();
  }

}
View Full Code Here

Examples of com.cloudera.crunch.Pipeline.writeTextFile()

    }
  }, tableOf(strings(),strings()));
   
    PTable<String, Pair<Collection<String>, Collection<String>>> cogroup = Cogroup.cogroup(aTable, bTable);
   
    pipeline.writeTextFile(cogroup, "output-cogrouped");
    pipeline.run();
  }

}
View Full Code Here

Examples of com.cloudera.crunch.impl.mr.MRPipeline.writeTextFile()

      }
    }, pairs(ints(), ints()));
   
    PCollection<Pair<Integer, Integer>> sorted = Sort.sortPairs(pairs, by(1, ASCENDING), by(2, DESCENDING));
   
    pipeline.writeTextFile(sorted, "output-sorted");
    pipeline.run();
  }

}
View Full Code Here

Examples of com.cloudera.crunch.impl.mr.MRPipeline.writeTextFile()

    PTable<String, Integer> maxTemps = records
      .parallelDo(toYearTempPairsFn(), tableOf(strings(), ints()))
      .groupByKey()
      .combineValues(CombineFn.<String> MAX_INTS());
   
    pipeline.writeTextFile(maxTemps, "output");
    pipeline.run();
  }

  private static DoFn<String, Pair<String, Integer>> toYearTempPairsFn() {
    return new DoFn<String, Pair<String, Integer>>() {
View Full Code Here

Examples of com.cloudera.crunch.impl.mr.MRPipeline.writeTextFile()

    }
  }, tableOf(strings(),strings()));
   
    PTable<String, Pair<String, String>> join = Join.join(aTable, bTable);
   
    pipeline.writeTextFile(join, "output-joined");
    pipeline.run();
  }

}
View Full Code Here

Examples of com.cloudera.crunch.impl.mr.MRPipeline.writeTextFile()

    }
  }, tableOf(strings(),strings()));
   
    PTable<String, Pair<Collection<String>, Collection<String>>> cogroup = Cogroup.cogroup(aTable, bTable);
   
    pipeline.writeTextFile(cogroup, "output-cogrouped");
    pipeline.run();
  }

}
View Full Code Here

Examples of com.cloudera.crunch.impl.mr.MRPipeline.writeTextFile()

              emitter.emit(word);
            }
          }
        }, Writables.strings()); // Indicates the serialization format

    pipeline.writeTextFile(words, args[1]);

    pipeline.done();
  }
}
View Full Code Here

Examples of com.cloudera.crunch.impl.mr.MRPipeline.writeTextFile()

    PTable<String, String> wordDocs = CrunchUtils.extractWordFileTable(lines);

    PTable<String, String> result = CrunchUtils.uniqueValues(wordDocs);

    // Instruct the pipeline to write the resulting counts to a text file.
    pipeline.writeTextFile(result, args[1]);
    // Execute the pipeline as a MapReduce.
    pipeline.done();
  }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.