Package com.facebook.giraph.hive.output

Examples of com.facebook.giraph.hive.output.HiveOutputDescription


  /** Create a new runner */
  public HiveGiraphRunner() {
    conf = new HiveConf(getClass());
    hiveVertexInputDescription = new HiveInputDescription();
    hiveEdgeInputDescription = new HiveInputDescription();
    hiveOutputDescription = new HiveOutputDescription();
  }
View Full Code Here


  public static final List<MapWritable> mapperData2 = ImmutableList.of(row3, row4);

  private HiveTools() {}

  public static void setupJob(Configuration conf) throws IOException {
    HiveOutputDescription outputDesc = new HiveOutputDescription();
    outputDesc.setDbName("default");
    outputDesc.setTableName("hive_io_test");
    Map<String, String> partitionValues = ImmutableMap.of("ds", "2013-04-01");
    outputDesc.setPartitionValues(partitionValues);
    LOG.info("Writing to " + outputDesc);
    try {
      HiveApiOutputFormat.initProfile(conf, outputDesc, SAMPLE_PROFILE_ID);
    } catch (TException e) {
      LOG.fatal("Failed to initialize profile " + outputDesc);
View Full Code Here

  TBLPROPERTIES ('RETENTION_PLATINUM'='90')
*/
public class WritingTool extends Configured implements Tool {
  @Override
  public int run(String[] args) throws Exception {
    HiveOutputDescription outputDesc = new HiveOutputDescription();
    outputDesc.setDbName("default");
    outputDesc.setTableName("hive_io_test");
    Map<String, String> partitionValues = ImmutableMap.of("ds", "2013-04-01");
    outputDesc.setPartitionValues(partitionValues);
    HiveApiOutputFormat.initProfile(getConf(), outputDesc, SAMPLE_PROFILE_ID);

    Job job = new Job(getConf(), "hive-io-writing");
    job.setMapperClass(SampleMapper.class);
    job.setInputFormatClass(SampleInputFormat.class);
View Full Code Here

   * Read user's output description from Configuration
   *
   * @return HiveOutputDescription
   */
  public HiveOutputDescription readOutputDescription() {
    HiveOutputDescription hod = new HiveOutputDescription();
    String value = conf.get(getOutputDescriptionKey());
    Writables.readFieldsFromEncodedStr(value, hod);
    return hod;
  }
View Full Code Here

  public void commitJob(JobContext jobContext) throws IOException {
    baseCommitter.commitJob(jobContext);

    Configuration conf = jobContext.getConfiguration();
    OutputConf outputConf = new OutputConf(conf, profileId);
    HiveOutputDescription outputDesc = outputConf.readOutputDescription();
    OutputInfo outputInfo = outputConf.readOutputTableInfo();
    if (outputInfo.hasPartitionInfo()) {
      registerPartitions(conf, outputDesc, outputInfo);
    } else {
      noPartitionsCopyData(conf, outputInfo);
View Full Code Here

TOP

Related Classes of com.facebook.giraph.hive.output.HiveOutputDescription

Copyright © 2018 www.massapicom. 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.