From fac0c746532e133beb928a7f6a7e57b510b477a1 Mon Sep 17 00:00:00 2001 From: Fokko Driesprong Date: Mon, 22 Dec 2025 22:48:43 +0100 Subject: [PATCH 01/47] [maven-release-plugin] prepare release apache-parquet-1.17.0-rc0 --- parquet-arrow/pom.xml | 2 +- parquet-avro/pom.xml | 2 +- parquet-benchmarks/pom.xml | 2 +- parquet-cli/pom.xml | 2 +- parquet-column/pom.xml | 2 +- parquet-common/pom.xml | 2 +- parquet-encoding/pom.xml | 2 +- parquet-format-structures/pom.xml | 2 +- parquet-generator/pom.xml | 2 +- parquet-hadoop-bundle/pom.xml | 2 +- parquet-hadoop/pom.xml | 2 +- parquet-jackson/pom.xml | 2 +- parquet-protobuf/pom.xml | 2 +- parquet-thrift/pom.xml | 2 +- parquet-variant/pom.xml | 2 +- pom.xml | 4 ++-- 16 files changed, 17 insertions(+), 17 deletions(-) diff --git a/parquet-arrow/pom.xml b/parquet-arrow/pom.xml index de7a3d6789..524afb9602 100644 --- a/parquet-arrow/pom.xml +++ b/parquet-arrow/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0-SNAPSHOT + 1.17.0 4.0.0 diff --git a/parquet-avro/pom.xml b/parquet-avro/pom.xml index 68815da263..efbc6ad629 100644 --- a/parquet-avro/pom.xml +++ b/parquet-avro/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0-SNAPSHOT + 1.17.0 4.0.0 diff --git a/parquet-benchmarks/pom.xml b/parquet-benchmarks/pom.xml index b1003c2808..909485590d 100644 --- a/parquet-benchmarks/pom.xml +++ b/parquet-benchmarks/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0-SNAPSHOT + 1.17.0 4.0.0 diff --git a/parquet-cli/pom.xml b/parquet-cli/pom.xml index 86f895d370..05a87b269d 100644 --- a/parquet-cli/pom.xml +++ b/parquet-cli/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0-SNAPSHOT + 1.17.0 4.0.0 diff --git a/parquet-column/pom.xml b/parquet-column/pom.xml index 8bd11dcc26..c4b4eb8d67 100644 --- a/parquet-column/pom.xml +++ b/parquet-column/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0-SNAPSHOT + 1.17.0 4.0.0 diff --git a/parquet-common/pom.xml b/parquet-common/pom.xml index 08a3b1188b..a7c67e798d 100644 --- a/parquet-common/pom.xml +++ b/parquet-common/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0-SNAPSHOT + 1.17.0 4.0.0 diff --git a/parquet-encoding/pom.xml b/parquet-encoding/pom.xml index 8fef044823..d30d3192ba 100644 --- a/parquet-encoding/pom.xml +++ b/parquet-encoding/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0-SNAPSHOT + 1.17.0 4.0.0 diff --git a/parquet-format-structures/pom.xml b/parquet-format-structures/pom.xml index 5818f1dfdf..3e04681dd6 100644 --- a/parquet-format-structures/pom.xml +++ b/parquet-format-structures/pom.xml @@ -24,7 +24,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0-SNAPSHOT + 1.17.0 parquet-format-structures diff --git a/parquet-generator/pom.xml b/parquet-generator/pom.xml index b4f52428ba..012944d3b7 100644 --- a/parquet-generator/pom.xml +++ b/parquet-generator/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0-SNAPSHOT + 1.17.0 4.0.0 diff --git a/parquet-hadoop-bundle/pom.xml b/parquet-hadoop-bundle/pom.xml index 78689cd350..d572ab825d 100644 --- a/parquet-hadoop-bundle/pom.xml +++ b/parquet-hadoop-bundle/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0-SNAPSHOT + 1.17.0 4.0.0 diff --git a/parquet-hadoop/pom.xml b/parquet-hadoop/pom.xml index 5d133a2be4..1a78e6e87c 100644 --- a/parquet-hadoop/pom.xml +++ b/parquet-hadoop/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0-SNAPSHOT + 1.17.0 4.0.0 diff --git a/parquet-jackson/pom.xml b/parquet-jackson/pom.xml index cd1463ac04..eba447aef7 100644 --- a/parquet-jackson/pom.xml +++ b/parquet-jackson/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0-SNAPSHOT + 1.17.0 4.0.0 diff --git a/parquet-protobuf/pom.xml b/parquet-protobuf/pom.xml index cddd2dc166..cfa3471c4f 100644 --- a/parquet-protobuf/pom.xml +++ b/parquet-protobuf/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0-SNAPSHOT + 1.17.0 4.0.0 diff --git a/parquet-thrift/pom.xml b/parquet-thrift/pom.xml index ade1ec3cdc..7a160ee938 100644 --- a/parquet-thrift/pom.xml +++ b/parquet-thrift/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0-SNAPSHOT + 1.17.0 4.0.0 diff --git a/parquet-variant/pom.xml b/parquet-variant/pom.xml index 8f0bed6d6a..c6d7998d0e 100644 --- a/parquet-variant/pom.xml +++ b/parquet-variant/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0-SNAPSHOT + 1.17.0 4.0.0 diff --git a/pom.xml b/pom.xml index a4c3701df9..b0184d7465 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ org.apache.parquet parquet - 1.17.0-SNAPSHOT + 1.17.0 pom Apache Parquet Java @@ -38,7 +38,7 @@ scm:git:git@github.com:apache/parquet-mr.git scm:git:git@github.com:apache/parquet-mr.git scm:git:git@github.com:apache/parquet-mr.git - HEAD + apache-parquet-1.17.0-rc0 From 4147bc65aa4535d55fc222ad148b65a0ab0f90cc Mon Sep 17 00:00:00 2001 From: Fokko Driesprong Date: Mon, 22 Dec 2025 22:48:47 +0100 Subject: [PATCH 02/47] [maven-release-plugin] prepare for next development iteration --- parquet-arrow/pom.xml | 2 +- parquet-avro/pom.xml | 2 +- parquet-benchmarks/pom.xml | 2 +- parquet-cli/pom.xml | 2 +- parquet-column/pom.xml | 2 +- parquet-common/pom.xml | 2 +- parquet-encoding/pom.xml | 2 +- parquet-format-structures/pom.xml | 2 +- parquet-generator/pom.xml | 2 +- parquet-hadoop-bundle/pom.xml | 2 +- parquet-hadoop/pom.xml | 2 +- parquet-jackson/pom.xml | 2 +- parquet-protobuf/pom.xml | 2 +- parquet-thrift/pom.xml | 2 +- parquet-variant/pom.xml | 2 +- pom.xml | 4 ++-- 16 files changed, 17 insertions(+), 17 deletions(-) diff --git a/parquet-arrow/pom.xml b/parquet-arrow/pom.xml index 524afb9602..de7a3d6789 100644 --- a/parquet-arrow/pom.xml +++ b/parquet-arrow/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0 + 1.17.0-SNAPSHOT 4.0.0 diff --git a/parquet-avro/pom.xml b/parquet-avro/pom.xml index efbc6ad629..68815da263 100644 --- a/parquet-avro/pom.xml +++ b/parquet-avro/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0 + 1.17.0-SNAPSHOT 4.0.0 diff --git a/parquet-benchmarks/pom.xml b/parquet-benchmarks/pom.xml index 909485590d..b1003c2808 100644 --- a/parquet-benchmarks/pom.xml +++ b/parquet-benchmarks/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0 + 1.17.0-SNAPSHOT 4.0.0 diff --git a/parquet-cli/pom.xml b/parquet-cli/pom.xml index 05a87b269d..86f895d370 100644 --- a/parquet-cli/pom.xml +++ b/parquet-cli/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0 + 1.17.0-SNAPSHOT 4.0.0 diff --git a/parquet-column/pom.xml b/parquet-column/pom.xml index c4b4eb8d67..8bd11dcc26 100644 --- a/parquet-column/pom.xml +++ b/parquet-column/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0 + 1.17.0-SNAPSHOT 4.0.0 diff --git a/parquet-common/pom.xml b/parquet-common/pom.xml index a7c67e798d..08a3b1188b 100644 --- a/parquet-common/pom.xml +++ b/parquet-common/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0 + 1.17.0-SNAPSHOT 4.0.0 diff --git a/parquet-encoding/pom.xml b/parquet-encoding/pom.xml index d30d3192ba..8fef044823 100644 --- a/parquet-encoding/pom.xml +++ b/parquet-encoding/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0 + 1.17.0-SNAPSHOT 4.0.0 diff --git a/parquet-format-structures/pom.xml b/parquet-format-structures/pom.xml index 3e04681dd6..5818f1dfdf 100644 --- a/parquet-format-structures/pom.xml +++ b/parquet-format-structures/pom.xml @@ -24,7 +24,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0 + 1.17.0-SNAPSHOT parquet-format-structures diff --git a/parquet-generator/pom.xml b/parquet-generator/pom.xml index 012944d3b7..b4f52428ba 100644 --- a/parquet-generator/pom.xml +++ b/parquet-generator/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0 + 1.17.0-SNAPSHOT 4.0.0 diff --git a/parquet-hadoop-bundle/pom.xml b/parquet-hadoop-bundle/pom.xml index d572ab825d..78689cd350 100644 --- a/parquet-hadoop-bundle/pom.xml +++ b/parquet-hadoop-bundle/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0 + 1.17.0-SNAPSHOT 4.0.0 diff --git a/parquet-hadoop/pom.xml b/parquet-hadoop/pom.xml index 1a78e6e87c..5d133a2be4 100644 --- a/parquet-hadoop/pom.xml +++ b/parquet-hadoop/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0 + 1.17.0-SNAPSHOT 4.0.0 diff --git a/parquet-jackson/pom.xml b/parquet-jackson/pom.xml index eba447aef7..cd1463ac04 100644 --- a/parquet-jackson/pom.xml +++ b/parquet-jackson/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0 + 1.17.0-SNAPSHOT 4.0.0 diff --git a/parquet-protobuf/pom.xml b/parquet-protobuf/pom.xml index cfa3471c4f..cddd2dc166 100644 --- a/parquet-protobuf/pom.xml +++ b/parquet-protobuf/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0 + 1.17.0-SNAPSHOT 4.0.0 diff --git a/parquet-thrift/pom.xml b/parquet-thrift/pom.xml index 7a160ee938..ade1ec3cdc 100644 --- a/parquet-thrift/pom.xml +++ b/parquet-thrift/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0 + 1.17.0-SNAPSHOT 4.0.0 diff --git a/parquet-variant/pom.xml b/parquet-variant/pom.xml index c6d7998d0e..8f0bed6d6a 100644 --- a/parquet-variant/pom.xml +++ b/parquet-variant/pom.xml @@ -21,7 +21,7 @@ org.apache.parquet parquet ../pom.xml - 1.17.0 + 1.17.0-SNAPSHOT 4.0.0 diff --git a/pom.xml b/pom.xml index b0184d7465..a4c3701df9 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ org.apache.parquet parquet - 1.17.0 + 1.17.0-SNAPSHOT pom Apache Parquet Java @@ -38,7 +38,7 @@ scm:git:git@github.com:apache/parquet-mr.git scm:git:git@github.com:apache/parquet-mr.git scm:git:git@github.com:apache/parquet-mr.git - apache-parquet-1.17.0-rc0 + HEAD From f62b2c058a8eded070cf5be87b3406f763a172b6 Mon Sep 17 00:00:00 2001 From: Naoki Takezoe Date: Fri, 9 Jan 2026 00:21:37 +0900 Subject: [PATCH 03/47] MINOR: Fix error message in SimpleGroup.add() for binary (#3385) --- .../org/apache/parquet/example/data/simple/SimpleGroup.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parquet-column/src/main/java/org/apache/parquet/example/data/simple/SimpleGroup.java b/parquet-column/src/main/java/org/apache/parquet/example/data/simple/SimpleGroup.java index 7632081390..5f4873220e 100644 --- a/parquet-column/src/main/java/org/apache/parquet/example/data/simple/SimpleGroup.java +++ b/parquet-column/src/main/java/org/apache/parquet/example/data/simple/SimpleGroup.java @@ -230,7 +230,7 @@ public void add(int fieldIndex, Binary value) { break; default: throw new UnsupportedOperationException( - getType().asPrimitiveType().getName() + " not supported for Binary"); + getType().getType(fieldIndex).asPrimitiveType().getName() + " not supported for Binary"); } } From d5114473b34938e6a24b958fc50d7efdedd7fae4 Mon Sep 17 00:00:00 2001 From: Fokko Driesprong Date: Tue, 13 Jan 2026 10:23:58 +0100 Subject: [PATCH 04/47] Prepare for next development iteration --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a4c3701df9..58c293a0cd 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ 3.3.0 2.12.0 - 1.16.0 + 1.17.0 thrift ${thrift.executable} 0.16.0 From 6abb257f5d7e6e7c1a1256acda07399e39998914 Mon Sep 17 00:00:00 2001 From: Aaron Niskode-Dossett Date: Tue, 13 Jan 2026 12:26:10 -0600 Subject: [PATCH 05/47] Minor: Remove comment from `pom.xml` (#3382) --- pom.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pom.xml b/pom.xml index 58c293a0cd..53957ddd1a 100644 --- a/pom.xml +++ b/pom.xml @@ -400,14 +400,6 @@
src/license.txt
true - From 6e4a249493e159598fc39c3671b4f76070f9875f Mon Sep 17 00:00:00 2001 From: Aaron Niskode-Dossett Date: Tue, 13 Jan 2026 12:27:09 -0600 Subject: [PATCH 06/47] Minor: `ci-before_install.sh` should show wget errors and retry (#3381) * [minor] ci-before_install.sh should show wget errors * update wget * Try non-gnu flag * add sleep & retries --- dev/ci-before_install.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dev/ci-before_install.sh b/dev/ci-before_install.sh index 6b57624a23..2cfaee56a3 100755 --- a/dev/ci-before_install.sh +++ b/dev/ci-before_install.sh @@ -23,14 +23,24 @@ export THRIFT_VERSION=0.22.0 set -e +set -o pipefail date sudo apt-get update -qq sudo apt-get install -qq --no-install-recommends build-essential pv autoconf automake libtool curl make \ - g++ unzip libboost-dev libboost-test-dev libboost-program-options-dev \ + g++ unzip libboost-dev libboost-test-dev libboost-program-options-dev wget \ libevent-dev automake libtool flex bison pkg-config g++ libssl-dev xmlstarlet date pwd -wget -qO- https://archive.apache.org/dist/thrift/$THRIFT_VERSION/thrift-$THRIFT_VERSION.tar.gz | tar zxf - +for attempt in 1 2 3; do + if wget -nv -O- https://archive.apache.org/dist/thrift/$THRIFT_VERSION/thrift-$THRIFT_VERSION.tar.gz | tar zxf -; then + break + fi + if [[ "$attempt" -eq 3 ]]; then + echo "Failed to download thrift after ${attempt} attempts." >&2 + exit 1 + fi + sleep $((attempt * 5)) +done cd thrift-${THRIFT_VERSION} chmod +x ./configure ./configure --disable-libs From 9ca04ca3f15d8cc6c1580edb52e3b81899931524 Mon Sep 17 00:00:00 2001 From: Aaron Niskode-Dossett Date: Tue, 13 Jan 2026 12:27:40 -0600 Subject: [PATCH 07/47] Minor: Upgrade spotless plugin (#3380) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 53957ddd1a..a4589d71bc 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ 2.19.2 0.23.1 1.3.2 - 2.30.0 + 2.46.1 shaded.parquet 3.3.0 From aa41aa121ff29e360273675edc899ba1c2640047 Mon Sep 17 00:00:00 2001 From: Aaron Niskode-Dossett Date: Tue, 13 Jan 2026 16:48:57 -0600 Subject: [PATCH 08/47] Update to Java 11 (#3379) --- .../IncrementallyUpdatedFilterPredicate.java | 4 +- .../io/RecordReaderImplementation.java | 2 +- .../parquet/schema/LogicalTypeAnnotation.java | 6 +- .../column/statistics/TestSizeStatistics.java | 16 ++-- .../ByteStreamSplitValuesReaderTest.java | 2 +- .../TestRunLengthBitPackingHybridEncoder.java | 5 +- .../recordlevel/TestValueInspector.java | 3 +- .../columnindex/TestColumnIndexBuilder.java | 27 +++--- .../io/ExpectationValidatingConverter.java | 3 +- .../org/apache/parquet/io/TestColumnIO.java | 6 +- .../schema/TestPrimitiveStringifier.java | 14 ++-- .../apache/parquet/SemanticVersionTest.java | 3 +- .../TestConcatenatingByteBufferCollector.java | 4 +- .../bytes/TestMultiBufferInputStream.java | 3 +- .../org/apache/parquet/glob/TestGlob.java | 54 ++++++------ .../converter/ParquetMetadataConverter.java | 4 +- .../apache/parquet/hadoop/PrintFooter.java | 3 +- .../mapred/DeprecatedParquetInputFormat.java | 3 +- .../crypto/keytools/samples/VaultClient.java | 4 +- .../parquet/encodings/FileEncodingsIT.java | 5 +- .../filter2/compat/TestRowGroupFilter.java | 23 +++-- .../dictionarylevel/DictionaryFilterTest.java | 5 +- .../recordlevel/TestRecordLevelFilters.java | 13 ++- .../statisticslevel/TestStatisticsFilter.java | 84 ++++++++----------- .../TestParquetMetadataConverter.java | 22 ++--- .../parquet/hadoop/TestBloomFiltering.java | 3 +- .../hadoop/TestColumnIndexFiltering.java | 3 +- .../parquet/hadoop/TestDataPageChecksums.java | 19 ++--- .../parquet/hadoop/TestInputFormat.java | 4 +- .../TestInputFormatColumnProjection.java | 3 +- .../hadoop/TestMergeMetadataFiles.java | 10 +-- .../parquet/hadoop/TestParquetFileWriter.java | 43 +++++----- .../parquet/hadoop/TestParquetReader.java | 5 +- .../hadoop/TestParquetReaderRandomAccess.java | 3 +- .../parquet/hadoop/TestParquetWriter.java | 4 +- .../hadoop/TestParquetWriterNewPage.java | 4 +- .../parquet/hadoop/TestStoreBloomFilter.java | 3 +- .../hadoop/example/TestInputOutputFormat.java | 3 +- .../hadoop/rewrite/ParquetRewriterTest.java | 12 +-- .../hadoop/util/ColumnEncryptorTest.java | 21 +++-- .../parquet/hadoop/util/ColumnPrunerTest.java | 21 +++-- .../parquet/statistics/TestColumnIndexes.java | 2 +- .../TestFloat16ReadWriteRoundTrip.java | 5 +- .../statistics/TestFloat16Statistics.java | 5 +- .../TestSizeStatisticsRoundTrip.java | 10 +-- .../parquet/statistics/TestStatistics.java | 7 +- 46 files changed, 233 insertions(+), 275 deletions(-) diff --git a/parquet-column/src/main/java/org/apache/parquet/filter2/recordlevel/IncrementallyUpdatedFilterPredicate.java b/parquet-column/src/main/java/org/apache/parquet/filter2/recordlevel/IncrementallyUpdatedFilterPredicate.java index c2aab2b6bf..7aea56b2a0 100644 --- a/parquet-column/src/main/java/org/apache/parquet/filter2/recordlevel/IncrementallyUpdatedFilterPredicate.java +++ b/parquet-column/src/main/java/org/apache/parquet/filter2/recordlevel/IncrementallyUpdatedFilterPredicate.java @@ -18,7 +18,7 @@ */ package org.apache.parquet.filter2.recordlevel; -import java.util.Arrays; +import java.util.List; import java.util.Objects; import org.apache.parquet.io.api.Binary; @@ -153,7 +153,7 @@ abstract static class DelegatingValueInspector extends ValueInspector { private final Iterable delegates; DelegatingValueInspector(ValueInspector... delegates) { - this.delegates = Arrays.asList(delegates); + this.delegates = List.of(delegates); } /** diff --git a/parquet-column/src/main/java/org/apache/parquet/io/RecordReaderImplementation.java b/parquet-column/src/main/java/org/apache/parquet/io/RecordReaderImplementation.java index ac2f74be6e..46c4b714a2 100644 --- a/parquet-column/src/main/java/org/apache/parquet/io/RecordReaderImplementation.java +++ b/parquet-column/src/main/java/org/apache/parquet/io/RecordReaderImplementation.java @@ -488,6 +488,6 @@ protected Converter getRecordConsumer() { protected Iterable getColumnReaders() { // Converting the array to an iterable ensures that the array cannot be altered - return Arrays.asList(columnReaders); + return List.of(columnReaders); } } diff --git a/parquet-column/src/main/java/org/apache/parquet/schema/LogicalTypeAnnotation.java b/parquet-column/src/main/java/org/apache/parquet/schema/LogicalTypeAnnotation.java index be98e071f6..98bc5c0237 100644 --- a/parquet-column/src/main/java/org/apache/parquet/schema/LogicalTypeAnnotation.java +++ b/parquet-column/src/main/java/org/apache/parquet/schema/LogicalTypeAnnotation.java @@ -18,7 +18,6 @@ */ package org.apache.parquet.schema; -import static java.util.Arrays.asList; import static java.util.Optional.empty; import static org.apache.parquet.schema.ColumnOrder.ColumnOrderName.TYPE_DEFINED_ORDER; import static org.apache.parquet.schema.ColumnOrder.ColumnOrderName.UNDEFINED; @@ -33,8 +32,6 @@ import static org.apache.parquet.schema.PrimitiveStringifier.TIME_STRINGIFIER; import static org.apache.parquet.schema.PrimitiveStringifier.TIME_UTC_STRINGIFIER; -import java.util.Collections; -import java.util.HashSet; import java.util.List; import java.util.Objects; import java.util.Optional; @@ -822,8 +819,7 @@ PrimitiveStringifier valueStringifier(PrimitiveType primitiveType) { } public static class IntLogicalTypeAnnotation extends LogicalTypeAnnotation { - private static final Set VALID_BIT_WIDTH = - Collections.unmodifiableSet(new HashSet<>(asList(8, 16, 32, 64))); + private static final Set VALID_BIT_WIDTH = Set.of(8, 16, 32, 64); private final int bitWidth; private final boolean isSigned; diff --git a/parquet-column/src/test/java/org/apache/parquet/column/statistics/TestSizeStatistics.java b/parquet-column/src/test/java/org/apache/parquet/column/statistics/TestSizeStatistics.java index 813298c2b6..786d2be2c3 100644 --- a/parquet-column/src/test/java/org/apache/parquet/column/statistics/TestSizeStatistics.java +++ b/parquet-column/src/test/java/org/apache/parquet/column/statistics/TestSizeStatistics.java @@ -18,8 +18,8 @@ */ package org.apache.parquet.column.statistics; -import java.util.Arrays; import java.util.Collections; +import java.util.List; import java.util.Optional; import org.apache.parquet.io.api.Binary; import org.apache.parquet.schema.LogicalTypeAnnotation; @@ -47,8 +47,8 @@ public void testAddBinaryType() { builder.add(1, 1); SizeStatistics statistics = builder.build(); Assert.assertEquals(Optional.of(3L), statistics.getUnencodedByteArrayDataBytes()); - Assert.assertEquals(Arrays.asList(3L, 3L, 1L), statistics.getRepetitionLevelHistogram()); - Assert.assertEquals(Arrays.asList(2L, 2L, 3L), statistics.getDefinitionLevelHistogram()); + Assert.assertEquals(List.of(3L, 3L, 1L), statistics.getRepetitionLevelHistogram()); + Assert.assertEquals(List.of(2L, 2L, 3L), statistics.getDefinitionLevelHistogram()); } @Test @@ -67,7 +67,7 @@ public void testAddNonBinaryType() { builder.add(1, 0); SizeStatistics statistics = builder.build(); Assert.assertEquals(Optional.empty(), statistics.getUnencodedByteArrayDataBytes()); - Assert.assertEquals(Arrays.asList(2L, 4L), statistics.getRepetitionLevelHistogram()); + Assert.assertEquals(List.of(2L, 4L), statistics.getRepetitionLevelHistogram()); Assert.assertEquals(Collections.emptyList(), statistics.getDefinitionLevelHistogram()); } @@ -89,8 +89,8 @@ public void testMergeStatistics() { SizeStatistics statistics2 = builder2.build(); statistics1.mergeStatistics(statistics2); Assert.assertEquals(Optional.of(5L), statistics1.getUnencodedByteArrayDataBytes()); - Assert.assertEquals(Arrays.asList(3L, 1L, 1L), statistics1.getRepetitionLevelHistogram()); - Assert.assertEquals(Arrays.asList(1L, 3L, 1L), statistics1.getDefinitionLevelHistogram()); + Assert.assertEquals(List.of(3L, 1L, 1L), statistics1.getRepetitionLevelHistogram()); + Assert.assertEquals(List.of(1L, 3L, 1L), statistics1.getDefinitionLevelHistogram()); } @Test @@ -122,8 +122,8 @@ public void testCopyStatistics() { SizeStatistics statistics = builder.build(); SizeStatistics copy = statistics.copy(); Assert.assertEquals(Optional.of(3L), copy.getUnencodedByteArrayDataBytes()); - Assert.assertEquals(Arrays.asList(1L, 1L, 1L), copy.getRepetitionLevelHistogram()); - Assert.assertEquals(Arrays.asList(1L, 1L, 1L), copy.getDefinitionLevelHistogram()); + Assert.assertEquals(List.of(1L, 1L, 1L), copy.getRepetitionLevelHistogram()); + Assert.assertEquals(List.of(1L, 1L, 1L), copy.getDefinitionLevelHistogram()); } @Test diff --git a/parquet-column/src/test/java/org/apache/parquet/column/values/bytestreamsplit/ByteStreamSplitValuesReaderTest.java b/parquet-column/src/test/java/org/apache/parquet/column/values/bytestreamsplit/ByteStreamSplitValuesReaderTest.java index 348d245595..dc37ed67ca 100644 --- a/parquet-column/src/test/java/org/apache/parquet/column/values/bytestreamsplit/ByteStreamSplitValuesReaderTest.java +++ b/parquet-column/src/test/java/org/apache/parquet/column/values/bytestreamsplit/ByteStreamSplitValuesReaderTest.java @@ -37,7 +37,7 @@ private static Reader makeReader(byte[] input, int throws Exception { ByteBuffer buffer = ByteBuffer.wrap(input); ByteBufferInputStream stream = ByteBufferInputStream.wrap(buffer); - Reader reader = cls.newInstance(); + Reader reader = cls.getDeclaredConstructor().newInstance(); reader.initFromPage(length, stream); return reader; } diff --git a/parquet-column/src/test/java/org/apache/parquet/column/values/rle/TestRunLengthBitPackingHybridEncoder.java b/parquet-column/src/test/java/org/apache/parquet/column/values/rle/TestRunLengthBitPackingHybridEncoder.java index 7ec5a9568c..93a6c8deb4 100644 --- a/parquet-column/src/test/java/org/apache/parquet/column/values/rle/TestRunLengthBitPackingHybridEncoder.java +++ b/parquet-column/src/test/java/org/apache/parquet/column/values/rle/TestRunLengthBitPackingHybridEncoder.java @@ -22,7 +22,6 @@ import java.io.ByteArrayInputStream; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import org.apache.parquet.bytes.BytesUtils; import org.apache.parquet.bytes.DirectByteBufferAllocator; @@ -187,7 +186,7 @@ public void testTransitionFromBitPackingToRle() throws Exception { assertEquals(3, BytesUtils.readUnsignedVarInt(is)); List values = unpack(3, 8, is); - assertEquals(Arrays.asList(0, 1, 0, 1, 0, 2, 2, 2), values); + assertEquals(List.of(0, 1, 0, 1, 0, 2, 2, 2), values); // header = 100 << 1 = 200 assertEquals(200, BytesUtils.readUnsignedVarInt(is)); @@ -212,7 +211,7 @@ public void testPaddingZerosOnUnfinishedBitPackedRuns() throws Exception { List values = unpack(5, 16, is); - assertEquals(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0), values); + assertEquals(List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0), values); assertEquals(-1, is.read()); } diff --git a/parquet-column/src/test/java/org/apache/parquet/filter2/recordlevel/TestValueInspector.java b/parquet-column/src/test/java/org/apache/parquet/filter2/recordlevel/TestValueInspector.java index a164e96665..e0c55c2764 100644 --- a/parquet-column/src/test/java/org/apache/parquet/filter2/recordlevel/TestValueInspector.java +++ b/parquet-column/src/test/java/org/apache/parquet/filter2/recordlevel/TestValueInspector.java @@ -24,7 +24,6 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import java.util.Arrays; import java.util.List; import org.apache.parquet.filter2.recordlevel.IncrementallyUpdatedFilterPredicate.ValueInspector; import org.junit.Test; @@ -83,7 +82,7 @@ public void testLifeCycle() { @Test public void testReusable() { - List values = Arrays.asList(2, 4, 7, 3, 8, 8, 11, 200); + List values = List.of(2, 4, 7, 3, 8, 8, 11, 200); ValueInspector v = intIsEven(); for (Integer x : values) { diff --git a/parquet-column/src/test/java/org/apache/parquet/internal/column/columnindex/TestColumnIndexBuilder.java b/parquet-column/src/test/java/org/apache/parquet/internal/column/columnindex/TestColumnIndexBuilder.java index 58a899eefc..6274f36263 100644 --- a/parquet-column/src/test/java/org/apache/parquet/internal/column/columnindex/TestColumnIndexBuilder.java +++ b/parquet-column/src/test/java/org/apache/parquet/internal/column/columnindex/TestColumnIndexBuilder.java @@ -18,7 +18,6 @@ */ package org.apache.parquet.internal.column.columnindex; -import static java.util.Arrays.asList; import static org.apache.parquet.filter2.predicate.FilterApi.and; import static org.apache.parquet.filter2.predicate.FilterApi.binaryColumn; import static org.apache.parquet.filter2.predicate.FilterApi.booleanColumn; @@ -688,8 +687,8 @@ public void testStaticBuildBinary() { ColumnIndex columnIndex = ColumnIndexBuilder.build( Types.required(BINARY).as(UTF8).named("test_binary_utf8"), BoundaryOrder.ASCENDING, - asList(true, true, false, false, true, false, true, false), - asList(1l, 2l, 3l, 4l, 5l, 6l, 7l, 8l), + List.of(true, true, false, false, true, false, true, false), + List.of(1l, 2l, 3l, 4l, 5l, 6l, 7l, 8l), toBBList( null, null, @@ -738,7 +737,7 @@ public void testFilterWithoutNullCounts() { ColumnIndex columnIndex = ColumnIndexBuilder.build( Types.required(BINARY).as(UTF8).named("test_binary_utf8"), BoundaryOrder.ASCENDING, - asList(true, true, false, false, true, false, true, false), + List.of(true, true, false, false, true, false, true, false), null, toBBList( null, @@ -904,8 +903,8 @@ public void testStaticBuildBoolean() { ColumnIndex columnIndex = ColumnIndexBuilder.build( Types.required(BOOLEAN).named("test_boolean"), BoundaryOrder.DESCENDING, - asList(false, true, false, true, false, true), - asList(9l, 8l, 7l, 6l, 5l, 0l), + List.of(false, true, false, true, false, true), + List.of(9l, 8l, 7l, 6l, 5l, 0l), toBBList(false, null, false, null, true, null), toBBList(true, null, false, null, true, null)); assertEquals(BoundaryOrder.DESCENDING, columnIndex.getBoundaryOrder()); @@ -1058,8 +1057,8 @@ public void testStaticBuildDouble() { ColumnIndex columnIndex = ColumnIndexBuilder.build( Types.required(DOUBLE).named("test_double"), BoundaryOrder.UNORDERED, - asList(false, false, false, false, false, false), - asList(0l, 1l, 2l, 3l, 4l, 5l), + List.of(false, false, false, false, false, false), + List.of(0l, 1l, 2l, 3l, 4l, 5l), toBBList(-1.0, -2.0, -3.0, -4.0, -5.0, -6.0), toBBList(1.0, 2.0, 3.0, 4.0, 5.0, 6.0)); assertEquals(BoundaryOrder.UNORDERED, columnIndex.getBoundaryOrder()); @@ -1211,8 +1210,8 @@ public void testStaticBuildFloat() { ColumnIndex columnIndex = ColumnIndexBuilder.build( Types.required(FLOAT).named("test_float"), BoundaryOrder.ASCENDING, - asList(true, true, true, false, false, false), - asList(9l, 8l, 7l, 6l, 0l, 0l), + List.of(true, true, true, false, false, false), + List.of(9l, 8l, 7l, 6l, 0l, 0l), toBBList(null, null, null, -3.0f, -2.0f, 0.1f), toBBList(null, null, null, -2.0f, 0.0f, 6.0f)); assertEquals(BoundaryOrder.ASCENDING, columnIndex.getBoundaryOrder()); @@ -1345,8 +1344,8 @@ public void testStaticBuildInt32() { ColumnIndex columnIndex = ColumnIndexBuilder.build( Types.required(INT32).named("test_int32"), BoundaryOrder.DESCENDING, - asList(false, false, false, true, true, true), - asList(0l, 10l, 0l, 3l, 5l, 7l), + List.of(false, false, false, true, true, true), + List.of(0l, 10l, 0l, 3l, 5l, 7l), toBBList(10, 8, 6, null, null, null), toBBList(9, 7, 5, null, null, null)); assertEquals(BoundaryOrder.DESCENDING, columnIndex.getBoundaryOrder()); @@ -1597,8 +1596,8 @@ public void testStaticBuildInt64() { ColumnIndex columnIndex = ColumnIndexBuilder.build( Types.required(INT64).named("test_int64"), BoundaryOrder.UNORDERED, - asList(true, false, true, false, true, false), - asList(1l, 2l, 3l, 4l, 5l, 6l), + List.of(true, false, true, false, true, false), + List.of(1l, 2l, 3l, 4l, 5l, 6l), toBBList(null, 2l, null, 4l, null, 9l), toBBList(null, 3l, null, 15l, null, 10l)); assertEquals(BoundaryOrder.UNORDERED, columnIndex.getBoundaryOrder()); diff --git a/parquet-column/src/test/java/org/apache/parquet/io/ExpectationValidatingConverter.java b/parquet-column/src/test/java/org/apache/parquet/io/ExpectationValidatingConverter.java index cf8e2edc09..99073c98ed 100644 --- a/parquet-column/src/test/java/org/apache/parquet/io/ExpectationValidatingConverter.java +++ b/parquet-column/src/test/java/org/apache/parquet/io/ExpectationValidatingConverter.java @@ -21,7 +21,6 @@ import static org.junit.Assert.assertEquals; import java.util.ArrayDeque; -import java.util.Arrays; import java.util.Deque; import java.util.List; import org.apache.parquet.io.api.Binary; @@ -48,7 +47,7 @@ public void validate(String got) { } public ExpectationValidatingConverter(String[] expectations, MessageType schema) { - this(new ArrayDeque<>(Arrays.asList(expectations)), schema); + this(new ArrayDeque<>(List.of(expectations)), schema); } public ExpectationValidatingConverter(Deque expectations, MessageType schema) { diff --git a/parquet-column/src/test/java/org/apache/parquet/io/TestColumnIO.java b/parquet-column/src/test/java/org/apache/parquet/io/TestColumnIO.java index ed1e232a8d..fa4fab710c 100644 --- a/parquet-column/src/test/java/org/apache/parquet/io/TestColumnIO.java +++ b/parquet-column/src/test/java/org/apache/parquet/io/TestColumnIO.java @@ -144,7 +144,7 @@ public class TestColumnIO { @Parameterized.Parameters public static Collection data() throws IOException { Object[][] data = {{true}, {false}}; - return Arrays.asList(data); + return List.of(data); } private boolean useDictionary; @@ -386,7 +386,7 @@ public void testOneOfEach() { .append("g", new NanoTime(1234, System.currentTimeMillis() * 1000)) .append("h", Binary.fromString("abc")); - testSchema(oneOfEachSchema, Arrays.asList(g1)); + testSchema(oneOfEachSchema, List.of(g1)); } @Test @@ -398,7 +398,7 @@ public void testRequiredOfRequired() { Group g1 = gf.newGroup(); g1.addGroup("foo").append("bar", 2l); - testSchema(reqreqSchema, Arrays.asList(g1)); + testSchema(reqreqSchema, List.of(g1)); } @Test diff --git a/parquet-column/src/test/java/org/apache/parquet/schema/TestPrimitiveStringifier.java b/parquet-column/src/test/java/org/apache/parquet/schema/TestPrimitiveStringifier.java index 3101ecea0d..b165b200d2 100644 --- a/parquet-column/src/test/java/org/apache/parquet/schema/TestPrimitiveStringifier.java +++ b/parquet-column/src/test/java/org/apache/parquet/schema/TestPrimitiveStringifier.java @@ -19,7 +19,6 @@ package org.apache.parquet.schema; import static java.nio.charset.StandardCharsets.UTF_8; -import static java.util.Arrays.asList; import static java.util.concurrent.TimeUnit.HOURS; import static java.util.concurrent.TimeUnit.MICROSECONDS; import static java.util.concurrent.TimeUnit.MILLISECONDS; @@ -48,6 +47,7 @@ import java.nio.ByteBuffer; import java.util.Calendar; import java.util.HashSet; +import java.util.List; import java.util.Set; import java.util.TimeZone; import java.util.concurrent.TimeUnit; @@ -175,7 +175,7 @@ public void testDateStringifier() { @Test public void testTimestampMillisStringifier() { for (PrimitiveStringifier stringifier : - asList(TIMESTAMP_MILLIS_STRINGIFIER, TIMESTAMP_MILLIS_UTC_STRINGIFIER)) { + List.of(TIMESTAMP_MILLIS_STRINGIFIER, TIMESTAMP_MILLIS_UTC_STRINGIFIER)) { String timezoneAmendment = (stringifier == TIMESTAMP_MILLIS_STRINGIFIER ? "" : "+0000"); assertEquals(withZoneString("1970-01-01T00:00:00.000", timezoneAmendment), stringifier.stringify(0l)); @@ -202,7 +202,7 @@ public void testTimestampMillisStringifier() { @Test public void testTimestampMicrosStringifier() { for (PrimitiveStringifier stringifier : - asList(TIMESTAMP_MICROS_STRINGIFIER, TIMESTAMP_MICROS_UTC_STRINGIFIER)) { + List.of(TIMESTAMP_MICROS_STRINGIFIER, TIMESTAMP_MICROS_UTC_STRINGIFIER)) { String timezoneAmendment = (stringifier == TIMESTAMP_MICROS_STRINGIFIER ? "" : "+0000"); assertEquals(withZoneString("1970-01-01T00:00:00.000000", timezoneAmendment), stringifier.stringify(0l)); @@ -228,7 +228,7 @@ public void testTimestampMicrosStringifier() { @Test public void testTimestampNanosStringifier() { - for (PrimitiveStringifier stringifier : asList(TIMESTAMP_NANOS_STRINGIFIER, TIMESTAMP_NANOS_UTC_STRINGIFIER)) { + for (PrimitiveStringifier stringifier : List.of(TIMESTAMP_NANOS_STRINGIFIER, TIMESTAMP_NANOS_UTC_STRINGIFIER)) { String timezoneAmendment = (stringifier == TIMESTAMP_NANOS_STRINGIFIER ? "" : "+0000"); assertEquals(withZoneString("1970-01-01T00:00:00.000000000", timezoneAmendment), stringifier.stringify(0l)); @@ -254,7 +254,7 @@ public void testTimestampNanosStringifier() { @Test public void testTimeStringifier() { - for (PrimitiveStringifier stringifier : asList(TIME_STRINGIFIER, TIME_UTC_STRINGIFIER)) { + for (PrimitiveStringifier stringifier : List.of(TIME_STRINGIFIER, TIME_UTC_STRINGIFIER)) { String timezoneAmendment = (stringifier == TIME_STRINGIFIER ? "" : "+0000"); assertEquals(withZoneString("00:00:00.000", timezoneAmendment), stringifier.stringify(0)); @@ -290,7 +290,7 @@ public void testTimeStringifier() { @Test public void testTimeNanoStringifier() { - for (PrimitiveStringifier stringifier : asList(TIME_NANOS_STRINGIFIER, TIME_NANOS_UTC_STRINGIFIER)) { + for (PrimitiveStringifier stringifier : List.of(TIME_NANOS_STRINGIFIER, TIME_NANOS_UTC_STRINGIFIER)) { String timezoneAmendment = (stringifier == TIME_NANOS_STRINGIFIER ? "" : "+0000"); assertEquals(withZoneString("00:00:00.000000000", timezoneAmendment), stringifier.stringify(0l)); @@ -434,7 +434,7 @@ private Binary toBinary(int... bytes) { } private void checkThrowingUnsupportedException(PrimitiveStringifier stringifier, Class... excludes) { - Set> set = new HashSet<>(asList(excludes)); + Set> set = new HashSet<>(List.of(excludes)); if (!set.contains(Integer.TYPE)) { try { stringifier.stringify(0); diff --git a/parquet-common/src/test/java/org/apache/parquet/SemanticVersionTest.java b/parquet-common/src/test/java/org/apache/parquet/SemanticVersionTest.java index 602ea374cb..e29352d402 100644 --- a/parquet-common/src/test/java/org/apache/parquet/SemanticVersionTest.java +++ b/parquet-common/src/test/java/org/apache/parquet/SemanticVersionTest.java @@ -21,7 +21,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import java.util.Arrays; import java.util.List; import org.junit.Test; @@ -51,7 +50,7 @@ public void testCompare() { @Test public void testSemverPrereleaseExamples() throws Exception { - List examples = Arrays.asList( + List examples = List.of( "1.0.0-alpha", "1.0.0-alpha.1", "1.0.0-alpha.beta", diff --git a/parquet-common/src/test/java/org/apache/parquet/bytes/TestConcatenatingByteBufferCollector.java b/parquet-common/src/test/java/org/apache/parquet/bytes/TestConcatenatingByteBufferCollector.java index 8b3a9cabaf..d973a7c96a 100644 --- a/parquet-common/src/test/java/org/apache/parquet/bytes/TestConcatenatingByteBufferCollector.java +++ b/parquet-common/src/test/java/org/apache/parquet/bytes/TestConcatenatingByteBufferCollector.java @@ -24,7 +24,7 @@ import java.io.InputStream; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; -import java.util.Arrays; +import java.util.List; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -54,7 +54,7 @@ public void test() throws IOException { ConcatenatingByteBufferCollector inner = new ConcatenatingByteBufferCollector(allocator)) { outer.collect(BytesInput.concat( BytesInput.from(byteBuffer("This"), byteBuffer(" "), byteBuffer("is")), - BytesInput.from(Arrays.asList(byteBuffer(" a"), byteBuffer(" "), byteBuffer("test"))), + BytesInput.from(List.of(byteBuffer(" a"), byteBuffer(" "), byteBuffer("test"))), BytesInput.from(inputStream(" text to blabla"), 8), BytesInput.from(bytes(" ")), BytesInput.from(bytes("blabla validate blabla"), 7, 9), diff --git a/parquet-common/src/test/java/org/apache/parquet/bytes/TestMultiBufferInputStream.java b/parquet-common/src/test/java/org/apache/parquet/bytes/TestMultiBufferInputStream.java index a6ddfe794d..2c1b1ff52a 100644 --- a/parquet-common/src/test/java/org/apache/parquet/bytes/TestMultiBufferInputStream.java +++ b/parquet-common/src/test/java/org/apache/parquet/bytes/TestMultiBufferInputStream.java @@ -21,13 +21,12 @@ import java.nio.ByteBuffer; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import org.junit.Assert; import org.junit.Test; public class TestMultiBufferInputStream extends TestByteBufferInputStreams { - private static final List DATA = Arrays.asList( + private static final List DATA = List.of( ByteBuffer.wrap(new byte[] {0, 1, 2, 3, 4, 5, 6, 7, 8}), ByteBuffer.wrap(new byte[] {9, 10, 11, 12}), ByteBuffer.wrap(new byte[] {}), diff --git a/parquet-common/src/test/java/org/apache/parquet/glob/TestGlob.java b/parquet-common/src/test/java/org/apache/parquet/glob/TestGlob.java index 34bf7f4182..433cc360f6 100644 --- a/parquet-common/src/test/java/org/apache/parquet/glob/TestGlob.java +++ b/parquet-common/src/test/java/org/apache/parquet/glob/TestGlob.java @@ -21,7 +21,7 @@ import static junit.framework.Assert.fail; import static org.junit.Assert.assertEquals; -import java.util.Arrays; +import java.util.List; import junit.framework.Assert; import org.apache.parquet.Strings; import org.apache.parquet.glob.GlobParser.GlobParseException; @@ -31,28 +31,28 @@ public class TestGlob { @Test public void testNoGlobs() { - assertEquals(Arrays.asList("foo"), Strings.expandGlob("foo")); + assertEquals(List.of("foo"), Strings.expandGlob("foo")); } @Test public void testEmptyGroup() { - assertEquals(Arrays.asList(""), Strings.expandGlob("")); - assertEquals(Arrays.asList(""), Strings.expandGlob("{}")); - assertEquals(Arrays.asList("a"), Strings.expandGlob("a{}")); - assertEquals(Arrays.asList("ab"), Strings.expandGlob("a{}b")); - assertEquals(Arrays.asList("a"), Strings.expandGlob("{}a")); - assertEquals(Arrays.asList("a"), Strings.expandGlob("a{}")); - assertEquals(Arrays.asList("", ""), Strings.expandGlob("{,}")); - assertEquals(Arrays.asList("ab", "a", "ac"), Strings.expandGlob("a{b,{},c}")); + assertEquals(List.of(""), Strings.expandGlob("")); + assertEquals(List.of(""), Strings.expandGlob("{}")); + assertEquals(List.of("a"), Strings.expandGlob("a{}")); + assertEquals(List.of("ab"), Strings.expandGlob("a{}b")); + assertEquals(List.of("a"), Strings.expandGlob("{}a")); + assertEquals(List.of("a"), Strings.expandGlob("a{}")); + assertEquals(List.of("", ""), Strings.expandGlob("{,}")); + assertEquals(List.of("ab", "a", "ac"), Strings.expandGlob("a{b,{},c}")); } @Test public void testSingleLevel() { - assertEquals(Arrays.asList("foobar", "foobaz"), Strings.expandGlob("foo{bar,baz}")); - assertEquals(Arrays.asList("startfooend", "startbarend"), Strings.expandGlob("start{foo,bar}end")); - assertEquals(Arrays.asList("fooend", "barend"), Strings.expandGlob("{foo,bar}end")); + assertEquals(List.of("foobar", "foobaz"), Strings.expandGlob("foo{bar,baz}")); + assertEquals(List.of("startfooend", "startbarend"), Strings.expandGlob("start{foo,bar}end")); + assertEquals(List.of("fooend", "barend"), Strings.expandGlob("{foo,bar}end")); assertEquals( - Arrays.asList( + List.of( "startfooenda", "startfooendb", "startfooendc", @@ -62,14 +62,14 @@ public void testSingleLevel() { "startbarendc", "startbarendd"), Strings.expandGlob("start{foo,bar}end{a,b,c,d}")); - assertEquals(Arrays.asList("xa", "xb", "xc", "ya", "yb", "yc"), Strings.expandGlob("{x,y}{a,b,c}")); - assertEquals(Arrays.asList("x", "y", "z"), Strings.expandGlob("{x,y,z}")); + assertEquals(List.of("xa", "xb", "xc", "ya", "yb", "yc"), Strings.expandGlob("{x,y}{a,b,c}")); + assertEquals(List.of("x", "y", "z"), Strings.expandGlob("{x,y,z}")); } @Test public void testNested() { assertEquals( - Arrays.asList( + List.of( "startoneend", "startpretwopostend", "startprethreepostend", @@ -84,9 +84,9 @@ public void testNested() { @Test public void testExtraBraces() { - assertEquals(Arrays.asList("x", "y", "z"), Strings.expandGlob("{{x,y,z}}")); - assertEquals(Arrays.asList("x", "y", "z"), Strings.expandGlob("{{{x,y,z}}}")); - assertEquals(Arrays.asList("startx", "starta", "startb", "starty"), Strings.expandGlob("start{x,{a,b},y}")); + assertEquals(List.of("x", "y", "z"), Strings.expandGlob("{{x,y,z}}")); + assertEquals(List.of("x", "y", "z"), Strings.expandGlob("{{{x,y,z}}}")); + assertEquals(List.of("startx", "starta", "startb", "starty"), Strings.expandGlob("start{x,{a,b},y}")); } @Test @@ -102,17 +102,17 @@ public void testCommaInTopLevel() { @Test public void testCommaCornerCases() { // single empty string in each location - assertEquals(Arrays.asList("foobar", "foo", "foobaz"), Strings.expandGlob("foo{bar,,baz}")); - assertEquals(Arrays.asList("foo", "foobar", "foobaz"), Strings.expandGlob("foo{,bar,baz}")); - assertEquals(Arrays.asList("foobar", "foobaz", "foo"), Strings.expandGlob("foo{bar,baz,}")); + assertEquals(List.of("foobar", "foo", "foobaz"), Strings.expandGlob("foo{bar,,baz}")); + assertEquals(List.of("foo", "foobar", "foobaz"), Strings.expandGlob("foo{,bar,baz}")); + assertEquals(List.of("foobar", "foobaz", "foo"), Strings.expandGlob("foo{bar,baz,}")); // multiple empty strings - assertEquals(Arrays.asList("foobar", "foo", "foo", "foobaz"), Strings.expandGlob("foo{bar,,,baz}")); - assertEquals(Arrays.asList("foo", "foo", "foobar", "foobaz"), Strings.expandGlob("foo{,,bar,baz}")); - assertEquals(Arrays.asList("foobar", "foobaz", "foo", "foo"), Strings.expandGlob("foo{bar,baz,,}")); + assertEquals(List.of("foobar", "foo", "foo", "foobaz"), Strings.expandGlob("foo{bar,,,baz}")); + assertEquals(List.of("foo", "foo", "foobar", "foobaz"), Strings.expandGlob("foo{,,bar,baz}")); + assertEquals(List.of("foobar", "foobaz", "foo", "foo"), Strings.expandGlob("foo{bar,baz,,}")); // between groups - assertEquals(Arrays.asList("x", "y", "", "a", "b"), Strings.expandGlob("{{x,y},,{a,b}}")); + assertEquals(List.of("x", "y", "", "a", "b"), Strings.expandGlob("{{x,y},,{a,b}}")); } private void assertNotEnoughCloseBraces(String s) { diff --git a/parquet-hadoop/src/main/java/org/apache/parquet/format/converter/ParquetMetadataConverter.java b/parquet-hadoop/src/main/java/org/apache/parquet/format/converter/ParquetMetadataConverter.java index 002028cdf5..60150439a6 100644 --- a/parquet-hadoop/src/main/java/org/apache/parquet/format/converter/ParquetMetadataConverter.java +++ b/parquet-hadoop/src/main/java/org/apache/parquet/format/converter/ParquetMetadataConverter.java @@ -1052,12 +1052,12 @@ enum SortOrder { UNKNOWN } - private static final Set STRING_TYPES = Collections.unmodifiableSet(new HashSet<>(Arrays.asList( + private static final Set STRING_TYPES = Set.of( LogicalTypeAnnotation.StringLogicalTypeAnnotation.class, LogicalTypeAnnotation.EnumLogicalTypeAnnotation.class, LogicalTypeAnnotation.JsonLogicalTypeAnnotation.class, LogicalTypeAnnotation.Float16LogicalTypeAnnotation.class, - LogicalTypeAnnotation.UnknownLogicalTypeAnnotation.class))); + LogicalTypeAnnotation.UnknownLogicalTypeAnnotation.class); /** * Returns whether to use signed order min and max with a type. It is safe to diff --git a/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/PrintFooter.java b/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/PrintFooter.java index 64153893d7..d50bccd03b 100644 --- a/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/PrintFooter.java +++ b/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/PrintFooter.java @@ -23,7 +23,6 @@ import java.net.URI; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.Deque; import java.util.LinkedHashMap; @@ -77,7 +76,7 @@ public static void main(String[] args) throws Exception { List statuses; if (fileStatus.isDir()) { System.out.println("listing files in " + fileStatus.getPath()); - statuses = Arrays.asList(fs.listStatus(fileStatus.getPath(), HiddenFileFilter.INSTANCE)); + statuses = List.of(fs.listStatus(fileStatus.getPath(), HiddenFileFilter.INSTANCE)); } else { statuses = new ArrayList(); statuses.add(fileStatus); diff --git a/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/mapred/DeprecatedParquetInputFormat.java b/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/mapred/DeprecatedParquetInputFormat.java index f10c574c41..f3e822528c 100644 --- a/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/mapred/DeprecatedParquetInputFormat.java +++ b/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/mapred/DeprecatedParquetInputFormat.java @@ -19,7 +19,6 @@ package org.apache.parquet.hadoop.mapred; import static java.lang.Boolean.TRUE; -import static java.util.Arrays.asList; import java.io.DataInput; import java.io.DataOutput; @@ -65,7 +64,7 @@ public InputSplit[] getSplits(JobConf job, int numSplits) throws IOException { } public List