Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/cql time datatype #15890

Closed
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 @@ -44,6 +44,7 @@ public enum Kind
BLOB,
UUID,
TIMEUUID,
TIME,
COUNTER,
VARINT,
INET,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import io.trino.spi.type.RowType;
import io.trino.spi.type.SmallintType;
import io.trino.spi.type.StandardTypes;
import io.trino.spi.type.TimeType;
import io.trino.spi.type.TimeZoneKey;
import io.trino.spi.type.TimestampWithTimeZoneType;
import io.trino.spi.type.TinyintType;
Expand Down Expand Up @@ -148,6 +149,8 @@ public Optional<CassandraType> toCassandraType(DataType dataType)
return Optional.of(CassandraTypes.SMALLINT);
case ProtocolConstants.DataType.TIMESTAMP:
return Optional.of(CassandraTypes.TIMESTAMP);
case ProtocolConstants.DataType.TIME:
return Optional.of(CassandraTypes.TIME);
case ProtocolConstants.DataType.TIMEUUID:
return Optional.of(CassandraTypes.TIMEUUID);
case ProtocolConstants.DataType.TINYINT:
Expand Down Expand Up @@ -661,6 +664,9 @@ public CassandraType toCassandraType(Type type, ProtocolVersion protocolVersion)
if (type.equals(TimestampWithTimeZoneType.TIMESTAMP_TZ_MILLIS)) {
return CassandraTypes.TIMESTAMP;
}
if (type.equals(TimeType.TIME_MILLIS)) {
return CassandraTypes.TIME;
}
if (type.equals(UuidType.UUID)) {
return CassandraTypes.UUID;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import io.trino.spi.type.IntegerType;
import io.trino.spi.type.RealType;
import io.trino.spi.type.SmallintType;
import io.trino.spi.type.TimeType;
import io.trino.spi.type.TimestampWithTimeZoneType;
import io.trino.spi.type.TinyintType;
import io.trino.spi.type.UuidType;
Expand Down Expand Up @@ -48,6 +49,7 @@ private CassandraTypes() {}
public static final CassandraType SET = new CassandraType(Kind.SET, createUnboundedVarcharType());
public static final CassandraType SMALLINT = new CassandraType(Kind.SMALLINT, SmallintType.SMALLINT);
public static final CassandraType TEXT = new CassandraType(Kind.TEXT, createUnboundedVarcharType());
public static final CassandraType TIME = new CassandraType(Kind.TIME, TimeType.TIME_MILLIS);
public static final CassandraType TIMESTAMP = new CassandraType(Kind.TIMESTAMP, TimestampWithTimeZoneType.TIMESTAMP_TZ_MILLIS);
public static final CassandraType TIMEUUID = new CassandraType(Kind.TIMEUUID, UuidType.UUID);
public static final CassandraType TINYINT = new CassandraType(Kind.TINYINT, TinyintType.TINYINT);
Expand Down