From ecf3f36fc1a3f61a7ea4d861def1b7eaf3740847 Mon Sep 17 00:00:00 2001 From: Danny Chan Date: Wed, 17 May 2023 10:07:11 +0800 Subject: [PATCH] [HUDI-6222] ParquetSchemaConverter shoud always convert the Map key type as not nullable (#8728) --- .../hudi/io/storage/row/parquet/ParquetSchemaConverter.java | 2 +- .../hudi/io/storage/row/parquet/TestParquetSchemaConverter.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hudi-client/hudi-flink-client/src/main/java/org/apache/hudi/io/storage/row/parquet/ParquetSchemaConverter.java b/hudi-client/hudi-flink-client/src/main/java/org/apache/hudi/io/storage/row/parquet/ParquetSchemaConverter.java index 7cd7c300670e..8bd1a8488553 100644 --- a/hudi-client/hudi-flink-client/src/main/java/org/apache/hudi/io/storage/row/parquet/ParquetSchemaConverter.java +++ b/hudi-client/hudi-flink-client/src/main/java/org/apache/hudi/io/storage/row/parquet/ParquetSchemaConverter.java @@ -650,7 +650,7 @@ private static Type convertToParquetType( .addField( Types .repeatedGroup() - .addField(convertToParquetType("key", keyType, repetition)) + .addField(convertToParquetType("key", keyType, Type.Repetition.REQUIRED)) .addField(convertToParquetType("value", valueType, repetition)) .named("key_value")) .named(name); diff --git a/hudi-client/hudi-flink-client/src/test/java/org/apache/hudi/io/storage/row/parquet/TestParquetSchemaConverter.java b/hudi-client/hudi-flink-client/src/test/java/org/apache/hudi/io/storage/row/parquet/TestParquetSchemaConverter.java index 3d5012b73b37..9e07edbd4ca0 100644 --- a/hudi-client/hudi-flink-client/src/test/java/org/apache/hudi/io/storage/row/parquet/TestParquetSchemaConverter.java +++ b/hudi-client/hudi-flink-client/src/test/java/org/apache/hudi/io/storage/row/parquet/TestParquetSchemaConverter.java @@ -56,7 +56,7 @@ void testConvertComplexTypes() { + " }\n" + " optional group f_map (MAP) {\n" + " repeated group key_value {\n" - + " optional int32 key;\n" + + " required int32 key;\n" + " optional binary value (STRING);\n" + " }\n" + " }\n"