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
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
import static io.trino.spi.type.TypeSignatureParameter.numericParameter;
import static java.lang.String.format;

public abstract class DecimalType
public abstract sealed class DecimalType
extends AbstractType
implements FixedWidthType
permits LongDecimalType, ShortDecimalType
{
public static final int DEFAULT_SCALE = 0;
public static final int DEFAULT_PRECISION = MAX_PRECISION;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import static java.lang.String.format;
import static java.lang.invoke.MethodHandles.lookup;

class LongTimeWithTimeZoneType
final class LongTimeWithTimeZoneType
extends TimeWithTimeZoneType
{
private static final TypeOperatorDeclaration TYPE_OPERATOR_DECLARATION = extractOperatorDeclaration(LongTimeWithTimeZoneType.class, lookup(), LongTimeWithTimeZone.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* in the first long and the fractional increment in the remaining integer, as a number of picoseconds
* additional to the epoch millisecond.
*/
class LongTimestampWithTimeZoneType
final class LongTimestampWithTimeZoneType
extends TimestampWithTimeZoneType
{
private static final TypeOperatorDeclaration TYPE_OPERATOR_DECLARATION = extractOperatorDeclaration(LongTimestampWithTimeZoneType.class, lookup(), LongTimestampWithTimeZone.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
/**
* Encodes time with time zone up to p = 9.
*/
class ShortTimeWithTimeZoneType
final class ShortTimeWithTimeZoneType
extends TimeWithTimeZoneType
{
private static final TypeOperatorDeclaration TYPE_OPERATOR_DECLARATION = extractOperatorDeclaration(ShortTimeWithTimeZoneType.class, lookup(), long.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* <p>
* The value is encoded as milliseconds from the 1970-01-01 00:00:00 epoch.
*/
class ShortTimestampWithTimeZoneType
final class ShortTimestampWithTimeZoneType
extends TimestampWithTimeZoneType
{
private static final TypeOperatorDeclaration TYPE_OPERATOR_DECLARATION = extractOperatorDeclaration(ShortTimestampWithTimeZoneType.class, lookup(), long.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
import static io.trino.spi.StandardErrorCode.NUMERIC_VALUE_OUT_OF_RANGE;
import static java.lang.String.format;

public abstract class TimeWithTimeZoneType
public abstract sealed class TimeWithTimeZoneType
extends AbstractType
implements FixedWidthType
permits LongTimeWithTimeZoneType, ShortTimeWithTimeZoneType
{
public static final int MAX_PRECISION = 12;
public static final int MAX_SHORT_PRECISION = 9;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
* @see ShortTimestampWithTimeZoneType
* @see LongTimestampWithTimeZoneType
*/
public abstract class TimestampWithTimeZoneType
public abstract sealed class TimestampWithTimeZoneType
extends AbstractType
implements FixedWidthType
permits LongTimestampWithTimeZoneType, ShortTimestampWithTimeZoneType
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @see LongTimestampWithTimeZoneType above became redundant

{
public static final int MAX_PRECISION = 12;

Expand Down