Examples of HiveOutputDescription


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

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

  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

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

  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

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

   * 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

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

  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

Examples of com.facebook.hiveio.output.HiveOutputDescription

   * Create HiveOutputDescription from Configuration
   *
   * @return HiveOutputDescription
   */
  private HiveOutputDescription makeOutputDesc() {
    HiveOutputDescription outputDesc = new HiveOutputDescription();
    HiveTableDesc tableDesc = outputDesc.getTableDesc();
    tableDesc.setDatabaseName(HIVE_VERTEX_OUTPUT_DATABASE.get(getConf()));
    tableDesc.setTableName(HIVE_VERTEX_OUTPUT_TABLE.get(getConf()));
    outputDesc.setPartitionValues(
        parsePartitionValues(HIVE_VERTEX_OUTPUT_PARTITION.get(getConf())));
    return outputDesc;
  }
View Full Code Here

Examples of com.facebook.hiveio.output.HiveOutputDescription

   *
   * @param conf Configuration
   * @throws IOException
   */
  public static void setupJob(Configuration conf) throws IOException {
    HiveOutputDescription outputDesc = new HiveOutputDescription();
    outputDesc.setTableDesc(getHiveTableName());
    Map<String, String> partitionValues = ImmutableMap.of("ds", "2013-04-01");
    outputDesc.setPartitionValues(partitionValues);
    LOG.info("Writing to {}", outputDesc);
    try {
      HiveApiOutputFormat.initProfile(conf, outputDesc, SampleOutputFormat.SAMPLE_PROFILE_ID);
    } catch (IOException e) {
      LOG.error("Failed to initialize profile {}", outputDesc);
View Full Code Here

Examples of com.facebook.hiveio.output.HiveOutputDescription

  }

  @Test
  public void testCheck() throws Exception {
    VertexToHive vertexToHive = new HiveOutputIntIntVertex();
    HiveOutputDescription outputDesc = new HiveOutputDescription();
    HiveTableSchema schema = TestSchema.builder()
        .addColumn("foo", HiveType.LONG)
        .addColumn("bar", HiveType.LONG)
        .build();
    vertexToHive.checkOutput(outputDesc, schema, newWritableRecord(schema));
View Full Code Here

Examples of com.facebook.hiveio.output.HiveOutputDescription

  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, SampleOutputFormat.SAMPLE_PROFILE_ID);
    } catch (TException e) {
      LOG.error("Failed to initialize profile {}", outputDesc);
View Full Code Here

Examples of com.facebook.hiveio.output.HiveOutputDescription

   *
   * @param conf Configuration
   * @throws IOException
   */
  public static void setupJob(Configuration conf) throws IOException {
    HiveOutputDescription outputDesc = new HiveOutputDescription();
    outputDesc.setTableDesc(getHiveTableName());
    Map<String, String> partitionValues = ImmutableMap.of("ds", "2013-04-01");
    outputDesc.setPartitionValues(partitionValues);
    LOG.info("Writing to {}", outputDesc);
    try {
      HiveApiOutputFormat.initProfile(conf, outputDesc, SampleOutputFormat.SAMPLE_PROFILE_ID);
    } catch (TException e) {
      LOG.error("Failed to initialize profile {}", outputDesc);
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.