From d8cbadf63745b50e8f565c2b76df837af93b3af2 Mon Sep 17 00:00:00 2001 From: David Stryker Date: Tue, 15 Sep 2020 10:34:44 -0700 Subject: [PATCH] Fix misuse of HashSet::new Fix a case where the column index was misused as a HashSet capacity parameter. --- .../java/io/prestosql/plugin/hive/HivePageSourceProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/presto-hive/src/main/java/io/prestosql/plugin/hive/HivePageSourceProvider.java b/presto-hive/src/main/java/io/prestosql/plugin/hive/HivePageSourceProvider.java index c4dee7f1488d..d279bb16bcf6 100644 --- a/presto-hive/src/main/java/io/prestosql/plugin/hive/HivePageSourceProvider.java +++ b/presto-hive/src/main/java/io/prestosql/plugin/hive/HivePageSourceProvider.java @@ -362,7 +362,7 @@ public static List buildColumnMappings( } checkArgument( - projectionsForColumn.computeIfAbsent(column.getBaseHiveColumnIndex(), HashSet::new).add(column.getHiveColumnProjectionInfo()), + projectionsForColumn.computeIfAbsent(column.getBaseHiveColumnIndex(), columnIndex -> new HashSet<>()).add(column.getHiveColumnProjectionInfo()), "duplicate column in columns list"); // Add regular mapping if projection is valid for partition schema, otherwise add an empty mapping