io.airlift.stats.cardinality.HyperLogLog.makeDense()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(115)

本文整理了Java中io.airlift.stats.cardinality.HyperLogLog.makeDense()方法的一些代码示例,展示了HyperLogLog.makeDense()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HyperLogLog.makeDense()方法的具体详情如下:
包路径:io.airlift.stats.cardinality.HyperLogLog
类名称:HyperLogLog
方法名:makeDense

HyperLogLog.makeDense介绍

暂无

代码示例

代码示例来源:origin: prestodb/presto

@ScalarOperator(CAST)
@SqlType(StandardTypes.P4_HYPER_LOG_LOG)
public static Slice castToP4Hll(@SqlType(StandardTypes.HYPER_LOG_LOG) Slice slice)
{
  HyperLogLog hll = HyperLogLog.newInstance(slice);
  hll.makeDense();
  return hll.serialize();
}

代码示例来源:origin: prestodb/presto

@Override
  public Object getExpectedValue(int start, int length)
  {
    if (length == 0) {
      return null;
    }

    HyperLogLog hll = HyperLogLog.newInstance(NUMBER_OF_BUCKETS);
    for (int i = start; i < start + length; i++) {
      hll.add(i);
    }
    hll.makeDense();
    return new SqlVarbinary(hll.serialize().getBytes());
  }
}

代码示例来源:origin: prestodb/presto

@Override
public Block[] getSequenceBlocks(int start, int length)
{
  BlockBuilder blockBuilder = HYPER_LOG_LOG.createBlockBuilder(null, length);
  for (int i = start; i < start + length; i++) {
    HyperLogLog hll = HyperLogLog.newInstance(NUMBER_OF_BUCKETS);
    hll.add(i);
    hll.makeDense();
    HYPER_LOG_LOG.writeSlice(blockBuilder, hll.serialize());
  }
  return new Block[] {blockBuilder.build()};
}

代码示例来源:origin: io.prestosql/presto-main

@ScalarOperator(CAST)
@SqlType(StandardTypes.P4_HYPER_LOG_LOG)
public static Slice castToP4Hll(@SqlType(StandardTypes.HYPER_LOG_LOG) Slice slice)
{
  HyperLogLog hll = HyperLogLog.newInstance(slice);
  hll.makeDense();
  return hll.serialize();
}

代码示例来源:origin: uk.co.nichesolutions.presto/presto-main

@ScalarOperator(CAST)
@SqlType(StandardTypes.P4_HYPER_LOG_LOG)
public static Slice castToP4Hll(@SqlType(StandardTypes.HYPER_LOG_LOG) Slice slice)
{
  HyperLogLog hll = HyperLogLog.newInstance(slice);
  hll.makeDense();
  return hll.serialize();
}

代码示例来源:origin: prestosql/presto

@ScalarOperator(CAST)
@SqlType(StandardTypes.P4_HYPER_LOG_LOG)
public static Slice castToP4Hll(@SqlType(StandardTypes.HYPER_LOG_LOG) Slice slice)
{
  HyperLogLog hll = HyperLogLog.newInstance(slice);
  hll.makeDense();
  return hll.serialize();
}

代码示例来源:origin: io.prestosql/presto-main

@Override
  public Object getExpectedValue(int start, int length)
  {
    if (length == 0) {
      return null;
    }

    HyperLogLog hll = HyperLogLog.newInstance(NUMBER_OF_BUCKETS);
    for (int i = start; i < start + length; i++) {
      hll.add(i);
    }
    hll.makeDense();
    return new SqlVarbinary(hll.serialize().getBytes());
  }
}

代码示例来源:origin: prestosql/presto

@Override
  public Object getExpectedValue(int start, int length)
  {
    if (length == 0) {
      return null;
    }

    HyperLogLog hll = HyperLogLog.newInstance(NUMBER_OF_BUCKETS);
    for (int i = start; i < start + length; i++) {
      hll.add(i);
    }
    hll.makeDense();
    return new SqlVarbinary(hll.serialize().getBytes());
  }
}

代码示例来源:origin: io.prestosql/presto-main

@Override
public Block[] getSequenceBlocks(int start, int length)
{
  BlockBuilder blockBuilder = HYPER_LOG_LOG.createBlockBuilder(null, length);
  for (int i = start; i < start + length; i++) {
    HyperLogLog hll = HyperLogLog.newInstance(NUMBER_OF_BUCKETS);
    hll.add(i);
    hll.makeDense();
    HYPER_LOG_LOG.writeSlice(blockBuilder, hll.serialize());
  }
  return new Block[] {blockBuilder.build()};
}

代码示例来源:origin: prestosql/presto

@Override
public Block[] getSequenceBlocks(int start, int length)
{
  BlockBuilder blockBuilder = HYPER_LOG_LOG.createBlockBuilder(null, length);
  for (int i = start; i < start + length; i++) {
    HyperLogLog hll = HyperLogLog.newInstance(NUMBER_OF_BUCKETS);
    hll.add(i);
    hll.makeDense();
    HYPER_LOG_LOG.writeSlice(blockBuilder, hll.serialize());
  }
  return new Block[] {blockBuilder.build()};
}

相关文章