io.prestosql.spi.block.Block.getEstimatedDataSizeForStats()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(99)

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

Block.getEstimatedDataSizeForStats介绍

[英]Returns the estimated in memory data size for stats of position. Do not use it for other purpose.
[中]返回位置统计信息的估计内存中数据大小。请勿将其用于其他用途。

代码示例

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

@Override
public long getEstimatedDataSizeForStats(int position)
{
  return block.getEstimatedDataSizeForStats(position);
}

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

@Override
public long getEstimatedDataSizeForStats(int position)
{
  return block.getEstimatedDataSizeForStats(position);
}

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

@Override
public long getEstimatedDataSizeForStats(int position)
{
  return value.getEstimatedDataSizeForStats(0);
}

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

@Override
public long getEstimatedDataSizeForStats(int position)
{
  assureLoaded();
  return block.getEstimatedDataSizeForStats(position);
}

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

@Override
public long getEstimatedDataSizeForStats(int position)
{
  return dictionary.getEstimatedDataSizeForStats(getId(position));
}

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

@Override
public long getEstimatedDataSizeForStats(int position)
{
  position = getAbsolutePosition(position);
  if (position % 2 == 0) {
    return getRawKeyBlock().getEstimatedDataSizeForStats(position / 2);
  }
  else {
    return getRawValueBlock().getEstimatedDataSizeForStats(position / 2);
  }
}

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

@Override
public long getEstimatedDataSizeForStats(int position)
{
  checkFieldIndex(position);
  return getRawFieldBlock(position).getEstimatedDataSizeForStats(rowIndex);
}

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

@Override
public long getEstimatedDataSizeForStats(int position)
{
  checkReadablePosition(position);
  return getBlock().getEstimatedDataSizeForStats(position + start);
}

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

@Test
public void testEstimatedDataSizeForStats()
{
  int positionCount = 10;
  Slice expectedValue = createExpectedValue(5);
  Block block = new RunLengthEncodedBlock(createSingleValueBlock(expectedValue), positionCount);
  for (int postition = 0; postition < positionCount; postition++) {
    assertEquals(block.getEstimatedDataSizeForStats(postition), expectedValue.length());
  }
}

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

@Test
public void testEstimatedDataSizeForStats()
{
  int positionCount = 10;
  Slice expectedValue = createExpectedValue(5);
  Block block = new RunLengthEncodedBlock(createSingleValueBlock(expectedValue), positionCount);
  for (int postition = 0; postition < positionCount; postition++) {
    assertEquals(block.getEstimatedDataSizeForStats(postition), expectedValue.length());
  }
}

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

protected static void assertEstimatedDataSizeForStats(BlockBuilder blockBuilder, Slice[] expectedSliceValues)
{
  Block block = blockBuilder.build();
  assertEquals(block.getPositionCount(), expectedSliceValues.length);
  for (int i = 0; i < block.getPositionCount(); i++) {
    int expectedSize = expectedSliceValues[i] == null ? 0 : expectedSliceValues[i].length();
    assertEquals(blockBuilder.getEstimatedDataSizeForStats(i), expectedSize);
    assertEquals(block.getEstimatedDataSizeForStats(i), expectedSize);
  }
  BlockBuilder nullValueBlockBuilder = blockBuilder.newBlockBuilderLike(null).appendNull();
  assertEquals(nullValueBlockBuilder.getEstimatedDataSizeForStats(0), 0);
  assertEquals(nullValueBlockBuilder.build().getEstimatedDataSizeForStats(0), 0);
}

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

protected static void assertEstimatedDataSizeForStats(BlockBuilder blockBuilder, Slice[] expectedSliceValues)
{
  Block block = blockBuilder.build();
  assertEquals(block.getPositionCount(), expectedSliceValues.length);
  for (int i = 0; i < block.getPositionCount(); i++) {
    int expectedSize = expectedSliceValues[i] == null ? 0 : expectedSliceValues[i].length();
    assertEquals(blockBuilder.getEstimatedDataSizeForStats(i), expectedSize);
    assertEquals(block.getEstimatedDataSizeForStats(i), expectedSize);
  }
  BlockBuilder nullValueBlockBuilder = blockBuilder.newBlockBuilderLike(null).appendNull();
  assertEquals(nullValueBlockBuilder.getEstimatedDataSizeForStats(0), 0);
  assertEquals(nullValueBlockBuilder.build().getEstimatedDataSizeForStats(0), 0);
}

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

@InputFunction
@TypeParameter(value = "T")
public static void input(@AggregationState NullableLongState state, @BlockPosition @SqlType("T") Block block, @BlockIndex int index)
{
  update(state, block.getEstimatedDataSizeForStats(index));
}

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

@InputFunction
@TypeParameter(value = "T")
public static void input(@AggregationState NullableLongState state, @BlockPosition @SqlType("T") Block block, @BlockIndex int index)
{
  update(state, block.getEstimatedDataSizeForStats(index));
}

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

@InputFunction
@TypeParameter(value = "T")
public static void input(@AggregationState NullableLongState state, @BlockPosition @SqlType("T") Block block, @BlockIndex int index)
{
  update(state, block.getEstimatedDataSizeForStats(index));
}

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

@InputFunction
@TypeParameter(value = "T")
public static void input(@AggregationState NullableLongState state, @BlockPosition @SqlType("T") Block block, @BlockIndex int index)
{
  update(state, block.getEstimatedDataSizeForStats(index));
}

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

@Test
public void testEstimatedDataSizeForStats()
{
  Map<String, Long>[] expectedValues = alternatingNullValues(createTestMap(9, 3, 4, 0, 8, 0, 6, 5));
  BlockBuilder blockBuilder = createBlockBuilderWithValues(expectedValues);
  Block block = blockBuilder.build();
  assertEquals(block.getPositionCount(), expectedValues.length);
  for (int i = 0; i < block.getPositionCount(); i++) {
    int expectedSize = getExpectedEstimatedDataSize(expectedValues[i]);
    assertEquals(blockBuilder.getEstimatedDataSizeForStats(i), expectedSize);
    assertEquals(block.getEstimatedDataSizeForStats(i), expectedSize);
  }
}

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

@Test
public void testEstimatedDataSizeForStats()
{
  long[][][] expectedValues = alternatingNullValues(createExpectedValues());
  BlockBuilder blockBuilder = createBlockBuilderWithValues(expectedValues);
  Block block = blockBuilder.build();
  assertEquals(block.getPositionCount(), expectedValues.length);
  for (int i = 0; i < block.getPositionCount(); i++) {
    int expectedSize = getExpectedEstimatedDataSize(expectedValues[i]);
    assertEquals(blockBuilder.getEstimatedDataSizeForStats(i), expectedSize);
    assertEquals(block.getEstimatedDataSizeForStats(i), expectedSize);
  }
}

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

@Test
public void testEstimatedDataSizeForStats()
{
  Map<String, Long>[] expectedValues = alternatingNullValues(createTestMap(9, 3, 4, 0, 8, 0, 6, 5));
  BlockBuilder blockBuilder = createBlockBuilderWithValues(expectedValues);
  Block block = blockBuilder.build();
  assertEquals(block.getPositionCount(), expectedValues.length);
  for (int i = 0; i < block.getPositionCount(); i++) {
    int expectedSize = getExpectedEstimatedDataSize(expectedValues[i]);
    assertEquals(blockBuilder.getEstimatedDataSizeForStats(i), expectedSize);
    assertEquals(block.getEstimatedDataSizeForStats(i), expectedSize);
  }
}

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

@Test
public void testEstimatedDataSizeForStats()
{
  long[][][] expectedValues = alternatingNullValues(createExpectedValues());
  BlockBuilder blockBuilder = createBlockBuilderWithValues(expectedValues);
  Block block = blockBuilder.build();
  assertEquals(block.getPositionCount(), expectedValues.length);
  for (int i = 0; i < block.getPositionCount(); i++) {
    int expectedSize = getExpectedEstimatedDataSize(expectedValues[i]);
    assertEquals(blockBuilder.getEstimatedDataSizeForStats(i), expectedSize);
    assertEquals(block.getEstimatedDataSizeForStats(i), expectedSize);
  }
}

相关文章