From f035067ae17430aec263bac03762fd40772d8650 Mon Sep 17 00:00:00 2001 From: Lu Niu Date: Fri, 12 Jan 2024 11:26:54 -0800 Subject: [PATCH] don't add empty collection in test data --- .../parquet/AbstractTestParquetReader.java | 29 ++++++++++--------- presto-native-execution/velox | 2 +- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/presto-hive/src/test/java/com/facebook/presto/hive/parquet/AbstractTestParquetReader.java b/presto-hive/src/test/java/com/facebook/presto/hive/parquet/AbstractTestParquetReader.java index 87071177c377c..3bd5807dafa0c 100644 --- a/presto-hive/src/test/java/com/facebook/presto/hive/parquet/AbstractTestParquetReader.java +++ b/presto-hive/src/test/java/com/facebook/presto/hive/parquet/AbstractTestParquetReader.java @@ -1808,12 +1808,15 @@ private List> createTestArrays(Iterable values) List array = new ArrayList<>(); while (valuesIter.hasNext()) { if (ThreadLocalRandom.current().nextBoolean()) { - arrays.add(array); + if (!array.isEmpty()) { + arrays.add(array); + } array = new ArrayList<>(); } - if (ThreadLocalRandom.current().nextInt(10) == 0) { - arrays.add(Collections.emptyList()); - } + // Don't add empty arrays +// if (ThreadLocalRandom.current().nextInt(10) == 0) { +// arrays.add(Collections.emptyList()); +// } array.add(valuesIter.next()); } return arrays; @@ -1835,9 +1838,9 @@ private List> createFixedTestArrays(Iterable values) arrays.add(array); array = new ArrayList<>(); } - if (count % 20 == 0) { - arrays.add(Collections.emptyList()); - } +// if (count % 20 == 0) { +// arrays.add(Collections.emptyList()); +// } array.add(valuesIter.next()); ++count; } @@ -1856,9 +1859,9 @@ private Iterable> createFixedTestMaps(Iterable keys, Iterabl maps.add(map); map = new HashMap<>(); } - if (count % 10 == 0) { - maps.add(Collections.emptyMap()); - } +// if (count % 10 == 0) { +// maps.add(Collections.emptyMap()); +// } map.put(keysIterator.next(), valuesIterator.next()); ++count; } @@ -1876,9 +1879,9 @@ private Iterable> createTestMaps(Iterable keys, Iterable maps.add(map); map = new HashMap<>(); } - if (ThreadLocalRandom.current().nextInt(10) == 0) { - maps.add(Collections.emptyMap()); - } +// if (ThreadLocalRandom.current().nextInt(10) == 0) { +// maps.add(Collections.emptyMap()); +// } map.put(keysIterator.next(), valuesIterator.next()); } return maps; diff --git a/presto-native-execution/velox b/presto-native-execution/velox index 8ff8d7a0e83b8..241f9c6d6ab69 160000 --- a/presto-native-execution/velox +++ b/presto-native-execution/velox @@ -1 +1 @@ -Subproject commit 8ff8d7a0e83b862456c4830249c3f3e9f51110eb +Subproject commit 241f9c6d6ab69506d3b0b6bf21c99afe1f40cd29