Package com.facebook.hiveio.schema

Examples of com.facebook.hiveio.schema.HiveTableSchema


    HiveOutputDescription outputDesc = new HiveOutputDescription();
    outputDesc.putPartitionValue("ds", "foobar");
    outputDesc.setTableDesc(hiveTableDesc);

    HiveTableSchema schema = HiveTableSchemas.lookup(hiveServer.getClient(),
        null, hiveTableDesc);

    writeData(outputDesc, schema);

    HiveInputDescription inputDesc = new HiveInputDescription();
View Full Code Here


  }

  @Override public void checkInputSpecs(Configuration conf) {
    HiveInputDescription inputDesc =
        GiraphHiveConstants.HIVE_VERTEX_INPUT.makeInputDescription(conf);
    HiveTableSchema schema = getTableSchema();
    HiveToEdge<I, E> hiveToEdge = HiveUtils.newHiveToEdge(getConf(), schema);
    hiveToEdge.checkInput(inputDesc, schema);
  }
View Full Code Here

  @Override
  public void checkOutputSpecs(JobContext context)
    throws IOException, InterruptedException {
    hiveOutputFormat.checkOutputSpecs(context);
    HiveTableSchema schema = hiveOutputFormat.getTableSchema(getConf());
    VertexToHive<I, V, E> vertexToHive = newVertexToHive(getConf(), schema);
    vertexToHive.checkOutput(makeOutputDesc(), schema,
        HiveRecordFactory.newWritableRecord(schema));
  }
View Full Code Here

  @Override
  public void checkInputSpecs(Configuration conf) {
    HiveInputDescription inputDesc =
        GiraphHiveConstants.HIVE_VERTEX_INPUT.makeInputDescription(conf);
    HiveTableSchema schema = getTableSchema();
    HiveToVertex<I, V, E> hiveToVertex = newHiveToVertex(getConf(), schema);
    hiveToVertex.checkInput(inputDesc, schema);
  }
View Full Code Here

  public void checkOutput(HiveOutputDescription outputDesc,
      HiveTableSchema schema, HiveWritableRecord emptyRecord) { }

  @Override
  public void initialize() {
    HiveTableSchema schema = getTableSchema();
    ImmutableClassesGiraphConfiguration conf = getConf();

    vertexIdWriter = HiveJythonUtils.newValueWriter(schema,
        VERTEX_ID_COLUMN, conf, GraphType.VERTEX_ID,
        GiraphHiveConstants.VERTEX_ID_WRITER_JYTHON_NAME);
View Full Code Here

  @Override
  public void checkInputSpecs(Configuration conf) {
    HiveInputDescription inputDesc =
        GiraphHiveConstants.HIVE_MAPPING_INPUT.makeInputDescription(conf);
    HiveTableSchema schema = getTableSchema();
    HiveToMapping<I, B> hiveToMapping = newHiveToMapping(getConf(), schema);
    hiveToMapping.checkInput(inputDesc, schema);
  }
View Full Code Here

  @Override
  public void initializeRecords(Iterator<HiveReadableRecord> records) {
    super.initializeRecords(records);

    HiveTableSchema schema = getTableSchema();
    ImmutableClassesGiraphConfiguration conf = getConf();

    sourceIdReader = HiveJythonUtils.<I>newValueReader(schema,
        EDGE_SOURCE_ID_COLUMN, conf, GraphType.VERTEX_ID,
        GiraphHiveConstants.VERTEX_ID_READER_JYTHON_NAME);
View Full Code Here

  @Override
  public void initializeRecords(Iterator<HiveReadableRecord> records) {
    super.initializeRecords(records);

    HiveTableSchema schema = getTableSchema();
    ImmutableClassesGiraphConfiguration<I, V, E> conf = getConf();

    vertexIdReader = HiveJythonUtils.newValueReader(schema, VERTEX_ID_COLUMN,
        conf, GraphType.VERTEX_ID,
        GiraphHiveConstants.VERTEX_ID_READER_JYTHON_NAME);
View Full Code Here

      table = client.get_table(inputDesc.getDbName(), inputDesc.getTableName());
    } catch (Exception e) {
      throw new IOException(e);
    }

    final HiveTableSchema tableSchema = HiveTableSchemaImpl.fromTable(table);
    HiveTableSchemas.put(conf, myProfileId, tableSchema);

    List<InputPartition> partitions = computePartitions(inputDesc, client, table);

    List<InputSplit> splits = computeSplits(conf, inputDesc, tableSchema, partitions);
View Full Code Here

      outputInfo.setFinalOutputPath(outputInfo.getPartitionPath());
    } else {
      outputInfo.setFinalOutputPath(table.getSd().getLocation());
    }

    HiveTableSchema tableSchema = HiveTableSchemaImpl.fromTable(table);
    HiveTableSchemas.put(conf, profileId, tableSchema);

    OutputConf outputConf = new OutputConf(conf, profileId);
    outputConf.writeOutputDescription(outputDesc);
    outputConf.writeOutputTableInfo(outputInfo);
View Full Code Here

TOP

Related Classes of com.facebook.hiveio.schema.HiveTableSchema

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.