Skip to content

Commit

Permalink
PARQUET-2142: parquet-cli without hadoop throws java.lang.NoSuchMetho…
Browse files Browse the repository at this point in the history
…dError on any parquet file access command (#990)
  • Loading branch information
sekikn committed Oct 9, 2022
1 parent 44dc3a4 commit 62b774c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions parquet-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -100,7 +105,7 @@ Usage: parquet [options] [command] [command options]
Examples:
# print information for create
parquet help create
parquet help meta
See 'parquet help <command>' for more information on a specific command.
```
Expand Down

0 comments on commit 62b774c

Please sign in to comment.