Skip to content

Commit

Permalink
Structured Data Type Fix : Don't mutate the collection passed in by t…
Browse files Browse the repository at this point in the history
…he user in InsertRow (#846)

Don't mutate the collection passed in by the user in InsertRow
  • Loading branch information
sfc-gh-hmadan authored Sep 30, 2024
1 parent 02e4a70 commit efb4a3f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -423,7 +424,7 @@ private static ParquetBufferValue getStructValue(
boolean isDescendantsOfRepeatingGroup) {
Map<String, ?> structVal =
DataValidationUtil.validateAndParseIcebergStruct(path, value, insertRowsCurrIndex);
Set<String> extraFields = structVal.keySet();
Set<String> extraFields = new HashSet<>(structVal.keySet());
List<Object> listVal = new ArrayList<>(type.getFieldCount());
float estimatedParquetSize = 0f;
for (int i = 0; i < type.getFieldCount(); i++) {
Expand Down

0 comments on commit efb4a3f

Please sign in to comment.