Skip to content

Commit

Permalink
[BugFix]uuid in iceberg should be binary (#54978)
Browse files Browse the repository at this point in the history
Signed-off-by: zombee0 <[email protected]>
(cherry picked from commit 68a180a)

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/connector/ColumnTypeConverter.java
  • Loading branch information
zombee0 authored and mergify[bot] committed Jan 13, 2025
1 parent 7f9b9b2 commit 6cf9d81
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,12 @@ public static Type fromIcebergType(org.apache.iceberg.types.Type icebergType) {
primitiveType = PrimitiveType.DATETIME;
break;
case STRING:
<<<<<<< HEAD
case UUID:
return ScalarType.createDefaultExternalTableString();
=======
return ScalarType.createDefaultCatalogString();
>>>>>>> 68a180a995 ([BugFix]uuid in iceberg should be binary (#54978))
case DECIMAL:
int precision = ((Types.DecimalType) icebergType).precision();
int scale = ((Types.DecimalType) icebergType).scale();
Expand Down Expand Up @@ -649,6 +653,7 @@ public static Type fromIcebergType(org.apache.iceberg.types.Type icebergType) {
}
return new StructType(structFields);
case BINARY:
case UUID:
return Type.VARBINARY;
case TIME:
case FIXED:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ public void testString() {
Assert.assertEquals(resType, stringType);
}

@Test
public void testUUID() {
org.apache.iceberg.types.Type icebergType = Types.UUIDType.get();
Type resType = fromIcebergType(icebergType);
Assert.assertTrue(resType.isBinaryType());
}

@Test
public void testArray() {
Assert.assertEquals(fromIcebergType(Types.ListType.ofRequired(136, Types.IntegerType.get())),
Expand Down

0 comments on commit 6cf9d81

Please sign in to comment.