You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@parquet.apache.org by "Kengo Seki (Jira)" <ji...@apache.org> on 2022/08/25 23:56:00 UTC

[jira] [Commented] (PARQUET-2142) parquet-cli without hadoop throws java.lang.NoSuchMethodError on any parquet file access command

    [ https://issues.apache.org/jira/browse/PARQUET-2142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17585059#comment-17585059 ] 

Kengo Seki commented on PARQUET-2142:
-------------------------------------

I also came across this issue. As [~theosib-amazon] pointed out, parquet-cli-$PROJECT_VERSION-runtime.jar contains the same class as parquet-cli-$PROJECT_VERSION.jar with a different method signature, due to [the relocation of the org.apache.avro package|https://github.com/apache/parquet-mr/blob/apache-parquet-1.12.3/parquet-cli/pom.xml#L201-L206].

{code}
$ unzip target/parquet-cli-1.13.0-SNAPSHOT-runtime.jar org/apache/parquet/avro/AvroSchemaConverter.class
Archive:  target/parquet-cli-1.13.0-SNAPSHOT-runtime.jar
  inflating: org/apache/parquet/avro/AvroSchemaConverter.class  
$ javap -c org.apache.parquet.avro.AvroSchemaConverter

...

  public org.apache.parquet.schema.MessageType convert(shaded.parquet.org.apache.avro.Schema);

...

  public shaded.parquet.org.apache.avro.Schema convert(org.apache.parquet.schema.MessageType);

...
{code}

I'll submit a documentation fix to notifying users not to include unnecessary jars when running parquet-cli without Hadoop.

> parquet-cli without hadoop throws java.lang.NoSuchMethodError on any parquet file access command
> ------------------------------------------------------------------------------------------------
>
>                 Key: PARQUET-2142
>                 URL: https://issues.apache.org/jira/browse/PARQUET-2142
>             Project: Parquet
>          Issue Type: Bug
>          Components: parquet-cli
>    Affects Versions: 1.13.0
>         Environment: Amazon Linux 2, Java 8
>            Reporter: Timothy Miller
>            Priority: Blocker
>
> I can't do even basic things with parquet-cli from 1.13.0-SNAPSHOT.
> Steps to reproduce:
> {noformat}
> git clone <parquet-mr repo> 
> cd parquet-mr
> mvn clean install -DskipTests
> cd parquet-cli
> mvn clean install -DskipTests
> mvn dependency:copy-dependencies
> java -cp 'target/*:target/dependency/*' org.apache.parquet.cli.Main cat <parquet file>{noformat}
> Results:
> {noformat}
> Exception in thread "main" java.lang.NoSuchMethodError: org.apache.parquet.avro.AvroSchemaConverter.convert(Lorg/apache/parquet/schema/MessageType;)Lorg/apache/avro/Schema;
>     at org.apache.parquet.cli.util.Schemas.fromParquet(Schemas.java:89)
>     at org.apache.parquet.cli.BaseCommand.getAvroSchema(BaseCommand.java:405)
>     at org.apache.parquet.cli.commands.CatCommand.run(CatCommand.java:66)
>     at org.apache.parquet.cli.Main.run(Main.java:157)
>     at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
>     at org.apache.parquet.cli.Main.main(Main.java:187){noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)