Skip to content

Commit

Permalink
Update variable name
Browse files Browse the repository at this point in the history
The previous name was a left-over from previous implementation attempt.
  • Loading branch information
findepi committed Aug 3, 2023
1 parent 8d868f2 commit d60b4d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private static Optional<List<Column>> glueColumns(TypeManager typeManager, Table
glueTypeString.length() > GLUE_COLUMN_TYPE_LENGTH_LIMIT) {
return Optional.empty();
}
String trinoTypeName = TypeConverter.toTrinoType(icebergColumn.type(), typeManager).getTypeId().getId();
String trinoTypeId = TypeConverter.toTrinoType(icebergColumn.type(), typeManager).getTypeId().getId();
Column column = new Column()
.withName(icebergColumn.name())
.withType(glueTypeString)
Expand All @@ -133,12 +133,12 @@ private static Optional<List<Column>> glueColumns(TypeManager typeManager, Table
if (icebergColumn.isRequired()) {
parameters.put(COLUMN_TRINO_NOT_NULL_PROPERTY, "true");
}
if (firstColumn || !glueTypeString.equals(trinoTypeName)) {
if (trinoTypeName.length() > GLUE_COLUMN_PARAMETER_LENGTH_LIMIT) {
if (firstColumn || !glueTypeString.equals(trinoTypeId)) {
if (trinoTypeId.length() > GLUE_COLUMN_PARAMETER_LENGTH_LIMIT) {
return Optional.empty();
}
// Store type parameter for some (first) column so that we can later detect whether column parameters weren't erased by something.
parameters.put(COLUMN_TRINO_TYPE_ID_PROPERTY, trinoTypeName);
parameters.put(COLUMN_TRINO_TYPE_ID_PROPERTY, trinoTypeId);
}
column.setParameters(parameters.buildOrThrow());
glueColumns.add(column);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,9 @@ private Optional<List<ColumnMetadata>> getColumnMetadata(SchemaTableName tableNa
ImmutableList.Builder<ColumnMetadata> columns = ImmutableList.builderWithExpectedSize(glueColumns.size());
for (Column glueColumn : glueColumns) {
Map<String, String> columnParameters = getColumnParameters(glueColumn);
String trinoTypeName = columnParameters.getOrDefault(COLUMN_TRINO_TYPE_ID_PROPERTY, glueColumn.getType());
String trinoTypeId = columnParameters.getOrDefault(COLUMN_TRINO_TYPE_ID_PROPERTY, glueColumn.getType());
boolean notNull = parseBoolean(columnParameters.getOrDefault(COLUMN_TRINO_NOT_NULL_PROPERTY, "false"));
Type type = typeManager.getType(TypeId.of(trinoTypeName));
Type type = typeManager.getType(TypeId.of(trinoTypeId));
columns.add(ColumnMetadata.builder()
.setName(glueColumn.getName())
.setType(type)
Expand Down

0 comments on commit d60b4d0

Please sign in to comment.