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

[#1317] fix(trino-connector): Support Fixed type conversion #1318

Merged
merged 3 commits into from
Jan 8, 2024
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 @@ -505,7 +505,7 @@ private ColumnDTO[] createIcebergFullTypeColumns() {
ColumnDTO[] columnDTO = createFullTypeColumns();

Set<String> unsupportedType =
Sets.newHashSet("ByteType", "ShortType", "VarCharType", "FixedCharType", "FixedType");
Sets.newHashSet("ByteType", "ShortType", "VarCharType", "FixedCharType");
return Arrays.stream(columnDTO)
.filter(c -> !unsupportedType.contains(c.name()))
.toArray(ColumnDTO[]::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

/** Type transformer between Hive and Trino */
public class HiveDataTypeTransformer extends GeneralDataTypeTransformer {
// Hive varchar max length of 65535
// Max length of Hive varchar is 65535
private static final int HIVE_VARCHAR_MAX_LENGTH = 65535;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.datastrato.gravitino.rel.types.Type.Name;
import com.datastrato.gravitino.rel.types.Types;
import com.datastrato.gravitino.trino.connector.util.GeneralDataTypeTransformer;
import io.trino.spi.type.VarbinaryType;

/** Type transformer between Iceberg and Trino */
public class IcebergDataTypeTransformer extends GeneralDataTypeTransformer {
Expand All @@ -21,4 +22,12 @@ public Type getGravitinoType(io.trino.spi.type.Type type) {
}
return gravitinoType;
}

@Override
public io.trino.spi.type.Type getTrinoType(Type type) {
if (Name.FIXED == type.name()) {
return VarbinaryType.VARBINARY;
}
return super.getTrinoType(type);
}
}
Loading