本文整理汇总了Java中org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableLongObjectInspector类的典型用法代码示例。如果您正苦于以下问题:Java WritableLongObjectInspector类的具体用法?Java WritableLongObjectInspector怎么用?Java WritableLongObjectInspector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WritableLongObjectInspector类属于org.apache.hadoop.hive.serde2.objectinspector.primitive包,在下文中一共展示了WritableLongObjectInspector类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: merge
import org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableLongObjectInspector; //导入依赖的package包/类
void merge(final int o_size, @Nonnull final Object o_sum, @Nonnull final Object o_count,
@Nonnull final StandardListObjectInspector sumOI,
@Nonnull final StandardListObjectInspector countOI) throws HiveException {
final WritableDoubleObjectInspector sumElemOI = PrimitiveObjectInspectorFactory.writableDoubleObjectInspector;
final WritableLongObjectInspector countElemOI = PrimitiveObjectInspectorFactory.writableLongObjectInspector;
if (o_size != _size) {
if (_size == -1) {
init(o_size);
} else {
throw new HiveException("Mismatch in the number of elements");
}
}
final double[] sum = _sum;
final long[] count = _count;
for (int i = 0, len = _size; i < len; i++) {
Object sum_e = sumOI.getListElement(o_sum, i);
sum[i] += sumElemOI.get(sum_e);
Object count_e = countOI.getListElement(o_count, i);
count[i] += countElemOI.get(count_e);
}
}