Search in sources :

Example 1 with HiveSerDeWrapper

use of org.apache.gobblin.hive.HiveSerDeWrapper in project incubator-gobblin by apache.

the class HiveWritableHdfsDataWriterBuilder method build.

@SuppressWarnings("deprecation")
@Override
public DataWriter<Writable> build() throws IOException {
    Preconditions.checkNotNull(this.destination);
    Preconditions.checkArgument(!Strings.isNullOrEmpty(this.writerId));
    State properties = this.destination.getProperties();
    if (!properties.contains(WRITER_WRITABLE_CLASS) || !properties.contains(WRITER_OUTPUT_FORMAT_CLASS)) {
        HiveSerDeWrapper serializer = HiveSerDeWrapper.getSerializer(properties);
        properties.setProp(WRITER_WRITABLE_CLASS, serializer.getSerDe().getSerializedClass().getName());
        properties.setProp(WRITER_OUTPUT_FORMAT_CLASS, serializer.getOutputFormatClassName());
    }
    return new HiveWritableHdfsDataWriter(this, properties);
}
Also used : State(org.apache.gobblin.configuration.State) HiveSerDeWrapper(org.apache.gobblin.hive.HiveSerDeWrapper)

Aggregations

State (org.apache.gobblin.configuration.State)1 HiveSerDeWrapper (org.apache.gobblin.hive.HiveSerDeWrapper)1