Package com.cloudera.crunch.impl.mr

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


    }, 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


      .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>>() {
      @Override
View Full Code Here

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

}
View Full Code Here

  }, 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

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.