Search in sources :

Example 1 with BucketCodec

use of org.apache.hadoop.hive.ql.io.BucketCodec in project hive by apache.

the class UDFToInteger method evaluate.

/**
 * Convert a RecordIdentifier.  This is done so that we can use the RecordIdentifier in place
 * of the bucketing column.
 * @param i RecordIdentifier to convert
 * @return value of the bucket identifier
 */
public IntWritable evaluate(RecordIdentifier i) {
    if (i == null) {
        return null;
    } else {
        BucketCodec decoder = BucketCodec.determineVersion(i.getBucketProperty());
        intWritable.set(decoder.decodeWriterId(i.getBucketProperty()));
        return intWritable;
    }
}
Also used : BucketCodec(org.apache.hadoop.hive.ql.io.BucketCodec)

Aggregations

BucketCodec (org.apache.hadoop.hive.ql.io.BucketCodec)1