Search in sources :

Example 6 with HCatWriter

use of org.apache.hive.hcatalog.data.transfer.HCatWriter in project hive by apache.

the class TestReaderWriter method commit.

private void commit(Map<String, String> config, boolean status, WriterContext context) throws IOException {
    WriteEntity.Builder builder = new WriteEntity.Builder();
    WriteEntity entity = builder.withTable("mytbl").build();
    HCatWriter writer = DataTransferFactory.getHCatWriter(entity, config);
    if (status) {
        writer.commit(context);
    } else {
        writer.abort(context);
    }
}
Also used : HCatWriter(org.apache.hive.hcatalog.data.transfer.HCatWriter) WriteEntity(org.apache.hive.hcatalog.data.transfer.WriteEntity)

Aggregations

HCatWriter (org.apache.hive.hcatalog.data.transfer.HCatWriter)6 WriteEntity (org.apache.hive.hcatalog.data.transfer.WriteEntity)4 WriterContext (org.apache.hive.hcatalog.data.transfer.WriterContext)3 FileInputStream (java.io.FileInputStream)1 ObjectInputStream (java.io.ObjectInputStream)1