Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions core/trino-main/src/test/java/io/trino/SequencePageBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
import static io.trino.spi.type.BigintType.BIGINT;
import static io.trino.spi.type.BooleanType.BOOLEAN;
import static io.trino.spi.type.DateType.DATE;
import static io.trino.spi.type.Decimals.isLongDecimal;
import static io.trino.spi.type.Decimals.isShortDecimal;
import static io.trino.spi.type.DoubleType.DOUBLE;
import static io.trino.spi.type.RealType.REAL;
import static io.trino.spi.type.TimestampType.TIMESTAMP_MILLIS;
Expand Down Expand Up @@ -69,11 +67,11 @@ else if (type.equals(DATE)) {
else if (type.equals(TIMESTAMP_MILLIS)) {
blocks[i] = BlockAssertions.createTimestampSequenceBlock(initialValue, initialValue + length);
}
else if (isShortDecimal(type)) {
blocks[i] = BlockAssertions.createShortDecimalSequenceBlock(initialValue, initialValue + length, (DecimalType) type);
else if (type instanceof DecimalType decimalType && decimalType.isShort()) {
blocks[i] = BlockAssertions.createShortDecimalSequenceBlock(initialValue, initialValue + length, decimalType);
}
else if (isLongDecimal(type)) {
blocks[i] = BlockAssertions.createLongDecimalSequenceBlock(initialValue, initialValue + length, (DecimalType) type);
else if (type instanceof DecimalType decimalType && !decimalType.isShort()) {
blocks[i] = BlockAssertions.createLongDecimalSequenceBlock(initialValue, initialValue + length, decimalType);
}
else {
throw new IllegalStateException("Unsupported type " + type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import io.trino.spi.block.BlockBuilder;
import io.trino.spi.block.TestingBlockEncodingSerde;
import io.trino.spi.type.DecimalType;
import io.trino.spi.type.Decimals;
import io.trino.spi.type.Int128;
import io.trino.spi.type.RowType;
import io.trino.spi.type.SqlDecimal;
Expand Down Expand Up @@ -242,7 +241,7 @@ private void writeValue(Type type, Object value, BlockBuilder blockBuilder)
else if (BIGINT.equals(type)) {
BIGINT.writeLong(blockBuilder, ((Number) value).longValue());
}
else if (Decimals.isLongDecimal(type)) {
else if (type instanceof DecimalType decimalType && !decimalType.isShort()) {
type.writeObject(blockBuilder, Int128.valueOf(((SqlDecimal) value).toBigDecimal().unscaledValue()));
}
else if (type instanceof VarcharType) {
Expand Down
147 changes: 0 additions & 147 deletions core/trino-spi/src/main/java/io/trino/spi/block/MethodHandleUtil.java

This file was deleted.

18 changes: 0 additions & 18 deletions core/trino-spi/src/main/java/io/trino/spi/type/Decimals.java
Original file line number Diff line number Diff line change
Expand Up @@ -259,24 +259,6 @@ public static BigInteger rescale(BigInteger value, int fromScale, int toScale)
return value.multiply(bigIntegerTenToNth(toScale - fromScale));
}

/**
* @deprecated Use {@link DecimalType#isShort()}
*/
@Deprecated
public static boolean isShortDecimal(Type type)
{
return type instanceof ShortDecimalType;
}

/**
* @deprecated Use {@link DecimalType#isShort()}
*/
@Deprecated
public static boolean isLongDecimal(Type type)
{
return type instanceof LongDecimalType;
}

/**
* Converts {@link BigDecimal} to {@link Int128} representing it for long {@link DecimalType}.
* It is caller responsibility to ensure that {@code value.scale()} equals to {@link DecimalType#getScale()}.
Expand Down
Loading