From e0b8db150be47a11bf9860f8fbdfa7a6327b7bc7 Mon Sep 17 00:00:00 2001 From: Huaxin Gao Date: Thu, 4 Apr 2024 08:25:48 -0700 Subject: [PATCH] fix: Only maps FIXED_LEN_BYTE_ARRAY to String for uuid type (#238) * Only maps FIXED_LEN_BYTE_ARRAY to String for uuid type * remove redundant code --------- Co-authored-by: Huaxin Gao --- common/src/main/java/org/apache/comet/parquet/TypeUtil.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/org/apache/comet/parquet/TypeUtil.java b/common/src/main/java/org/apache/comet/parquet/TypeUtil.java index 340bf9823..b8b7ff525 100644 --- a/common/src/main/java/org/apache/comet/parquet/TypeUtil.java +++ b/common/src/main/java/org/apache/comet/parquet/TypeUtil.java @@ -196,7 +196,9 @@ && isUnsignedIntTypeMatched(logicalTypeAnnotation, 64)) { || canReadAsBinaryDecimal(descriptor, sparkType) || sparkType == DataTypes.BinaryType // for uuid, since iceberg maps uuid to StringType - || sparkType == DataTypes.StringType) { + || sparkType == DataTypes.StringType + && logicalTypeAnnotation + instanceof LogicalTypeAnnotation.UUIDLogicalTypeAnnotation) { return; } break;