Search in sources :

Example 1 with SegmentNotWritableException

use of io.druid.segment.realtime.appenderator.SegmentNotWritableException in project hive by apache.

the class DruidRecordWriter method write.

@Override
public void write(Writable w) throws IOException {
    DruidWritable record = (DruidWritable) w;
    final long timestamp = (long) record.getValue().get(DruidTable.DEFAULT_TIMESTAMP_COLUMN);
    final long truncatedTime = (long) record.getValue().get(Constants.DRUID_TIMESTAMP_GRANULARITY_COL_NAME);
    InputRow inputRow = new MapBasedInputRow(timestamp, dataSchema.getParser().getParseSpec().getDimensionsSpec().getDimensionNames(), record.getValue());
    try {
        appenderator.add(getSegmentIdentifierAndMaybePush(truncatedTime), inputRow, committerSupplier);
    } catch (SegmentNotWritableException e) {
        throw new IOException(e);
    }
}
Also used : DruidWritable(org.apache.hadoop.hive.druid.serde.DruidWritable) SegmentNotWritableException(io.druid.segment.realtime.appenderator.SegmentNotWritableException) MapBasedInputRow(io.druid.data.input.MapBasedInputRow) InputRow(io.druid.data.input.InputRow) MapBasedInputRow(io.druid.data.input.MapBasedInputRow) IOException(java.io.IOException)

Aggregations

InputRow (io.druid.data.input.InputRow)1 MapBasedInputRow (io.druid.data.input.MapBasedInputRow)1 SegmentNotWritableException (io.druid.segment.realtime.appenderator.SegmentNotWritableException)1 IOException (java.io.IOException)1 DruidWritable (org.apache.hadoop.hive.druid.serde.DruidWritable)1