@Override void readFirstField(Block block, int position, DoubleAndBlockPositionValueState state) { state.setFirst(firstType.getDouble(block, position)); }
@Override public double getDouble(int field) { return types.get(field).getDouble(page.getBlock(field), position); }
@Override public void encodeValueInto(Block block, int position, SliceOutput output) { output.writeLong(Long.reverseBytes(Double.doubleToLongBits(type.getDouble(block, position)))); }
@Override public double getDouble(int field) { return types.get(field).getDouble(page.getBlock(field), position); }
@Override void readFirstField(Block block, int position, DoubleAndBlockPositionValueState state) { state.setFirst(firstType.getDouble(block, position)); }
private void encodeValue(Block block, int position, SliceOutput output) { double value = type.getDouble(block, position); buffer.setLength(0); buffer.append(value); for (int index = 0; index < buffer.length(); index++) { output.writeByte(buffer.charAt(index)); } }
@Override public double getDouble(int field) { checkState(position >= 0, "Not yet advanced"); checkState(position < page.getPositionCount(), "Already finished"); Type type = types.get(field); return type.getDouble(page.getBlock(field), position); }
@Override public double getDouble(int field) { checkState(position >= 0, "Not yet advanced"); checkState(position < page.getPositionCount(), "Already finished"); Type type = types.get(field); return type.getDouble(page.getBlock(field), position); }
@UsedByGeneratedCode public static Double doubleSubscript(Type elementType, Block array, long index) { checkIndex(array, index); int position = toIntExact(index - 1); if (array.isNull(position)) { return null; } return elementType.getDouble(array, position); }
@UsedByGeneratedCode public static Double doubleSubscript(Type elementType, Block array, long index) { checkIndex(array, index); int position = toIntExact(index - 1); if (array.isNull(position)) { return null; } return elementType.getDouble(array, position); }
public static void input(Type type, NullableDoubleState state, Block block, int position) { if (!state.isNull()) { return; } state.setNull(false); state.setDouble(type.getDouble(block, position)); }
public double getDouble(int channel, int position) { long pageAddress = valueAddresses.getLong(position); Block block = channels[channel].get(decodeSliceIndex(pageAddress)); int blockPosition = decodePosition(pageAddress); return types.get(channel).getDouble(block, blockPosition); }
public double getDouble(int channel, int position) { long pageAddress = valueAddresses.getLong(position); Block block = channels[channel].get(decodeSliceIndex(pageAddress)); int blockPosition = decodePosition(pageAddress); return types.get(channel).getDouble(block, blockPosition); }
public static void input(Type type, NullableDoubleState state, Block block, int position) { if (!state.isNull()) { return; } state.setNull(false); state.setDouble(type.getDouble(block, position)); }
@Override public void addBlock(Type type, Block block) { for (int position = 0; position < block.getPositionCount(); position++) { if (!block.isNull(position)) { double value; if (type == RealType.REAL) { value = Float.intBitsToFloat((int) type.getLong(block, position)); } else { value = type.getDouble(block, position); } addValue(value); } } }
@Override public void addBlock(Type type, Block block) { for (int position = 0; position < block.getPositionCount(); position++) { if (!block.isNull(position)) { double value; if (type == RealType.REAL) { value = Float.intBitsToFloat((int) type.getLong(block, position)); } else { value = type.getDouble(block, position); } addValue(value); } } }
@TypeParameter("T") @TypeParameterSpecialization(name = "T", nativeContainerType = double.class) @SqlType("array(T)") public Block sortDouble( @TypeParameter("T") Type type, @SqlType("array(T)") Block block, @SqlType("function(T, T, int)") ComparatorDoubleLambda function) { int arrayLength = block.getPositionCount(); initPositionsList(arrayLength); Comparator<Integer> comparator = (x, y) -> comparatorResult(function.apply( block.isNull(x) ? null : type.getDouble(block, x), block.isNull(y) ? null : type.getDouble(block, y))); sortPositions(arrayLength, comparator); return computeResultBlock(type, block, arrayLength); }
@TypeParameter("T") @TypeParameterSpecialization(name = "T", nativeContainerType = double.class) @SqlType("array(T)") public Block sortDouble( @TypeParameter("T") Type type, @SqlType("array(T)") Block block, @SqlType("function(T, T, int)") ComparatorDoubleLambda function) { int arrayLength = block.getPositionCount(); initPositionsList(arrayLength); Comparator<Integer> comparator = (x, y) -> comparatorResult(function.apply( block.isNull(x) ? null : type.getDouble(block, x), block.isNull(y) ? null : type.getDouble(block, y))); sortPositions(arrayLength, comparator); return computeResultBlock(type, block, arrayLength); }
@TypeParameter("E") @SqlNullable @SqlType("E") public static Double doubleElementAt(@TypeParameter("E") Type elementType, @SqlType("array(E)") Block array, @SqlType("bigint") long index) { int position = checkedIndexToBlockPosition(array, index); if (position == -1) { return null; } if (array.isNull(position)) { return null; } return elementType.getDouble(array, position); }
@TypeParameter("E") @SqlNullable @SqlType("E") public static Double doubleElementAt(@TypeParameter("E") Type elementType, @SqlType("array(E)") Block array, @SqlType("bigint") long index) { int position = checkedIndexToBlockPosition(array, index); if (position == -1) { return null; } if (array.isNull(position)) { return null; } return elementType.getDouble(array, position); }