From efb4a3f280c14fa4c3780c680aa8f60ec97555a3 Mon Sep 17 00:00:00 2001 From: Hitesh Madan Date: Mon, 30 Sep 2024 11:30:56 -0700 Subject: [PATCH] Structured Data Type Fix : Don't mutate the collection passed in by the user in InsertRow (#846) Don't mutate the collection passed in by the user in InsertRow --- .../ingest/streaming/internal/IcebergParquetValueParser.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/snowflake/ingest/streaming/internal/IcebergParquetValueParser.java b/src/main/java/net/snowflake/ingest/streaming/internal/IcebergParquetValueParser.java index 8c56896c7..71af27366 100644 --- a/src/main/java/net/snowflake/ingest/streaming/internal/IcebergParquetValueParser.java +++ b/src/main/java/net/snowflake/ingest/streaming/internal/IcebergParquetValueParser.java @@ -16,6 +16,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Optional; @@ -423,7 +424,7 @@ private static ParquetBufferValue getStructValue( boolean isDescendantsOfRepeatingGroup) { Map structVal = DataValidationUtil.validateAndParseIcebergStruct(path, value, insertRowsCurrIndex); - Set extraFields = structVal.keySet(); + Set extraFields = new HashSet<>(structVal.keySet()); List listVal = new ArrayList<>(type.getFieldCount()); float estimatedParquetSize = 0f; for (int i = 0; i < type.getFieldCount(); i++) {