From 62b774cd0f0c60cfbe540bbfa60bee15929af5d4 Mon Sep 17 00:00:00 2001 From: Kengo Seki Date: Mon, 10 Oct 2022 04:12:41 +0900 Subject: [PATCH] PARQUET-2142: parquet-cli without hadoop throws java.lang.NoSuchMethodError on any parquet file access command (#990) --- parquet-cli/README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/parquet-cli/README.md b/parquet-cli/README.md index d17d7199c5..da1d12319f 100644 --- a/parquet-cli/README.md +++ b/parquet-cli/README.md @@ -31,13 +31,13 @@ mvn clean install -DskipTests The build produces a shaded Jar that can be run using the `hadoop` command: ``` -hadoop jar parquet-cli-1.9.1-runtime.jar org.apache.parquet.cli.Main +hadoop jar parquet-cli-1.12.3-runtime.jar org.apache.parquet.cli.Main ``` For a shorter command-line invocation, add an alias to your shell like this: ``` -alias parquet="hadoop jar /path/to/parquet-cli-1.9.1-runtime.jar org.apache.parquet.cli.Main --dollar-zero parquet" +alias parquet="hadoop jar /path/to/parquet-cli-1.12.3-runtime.jar org.apache.parquet.cli.Main --dollar-zero parquet" ``` ### Running without Hadoop @@ -51,9 +51,14 @@ mvn dependency:copy-dependencies Then, run the command-line and add `target/dependencies/*` to the classpath: ``` -java -cp 'target/*:target/dependency/*' org.apache.parquet.cli.Main +java -cp 'target/parquet-cli-1.12.3.jar:target/dependency/*' org.apache.parquet.cli.Main ``` +Note that you shouldn't include the runtime jar used above into the classpath in this case. +In that jar, the `org.apache.avro package` is relocated for avoiding conflict with Hadoop's one. +That relocation changes method signatures, so it can cause `NoSuchMethodError` depending on the class loading order. +See PARQUET-2142 for details. + ### Help @@ -100,7 +105,7 @@ Usage: parquet [options] [command] [command options] Examples: # print information for create - parquet help create + parquet help meta See 'parquet help ' for more information on a specific command. ```