当前位置: 首页>>代码示例>>Java>>正文


Java WritableLongObjectInspector类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:apache,项目名称:incubator-hivemall,代码行数:23,代码来源:ArrayAvgGenericUDAF.java


注:本文中的org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableLongObjectInspector类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。