Thanks Julien for your help.
Adding the @JsonValue annotation as you suggested fixed the issue and
parquet-tools now can successfully read the generated parquet file.

James

On Thu, Jan 12, 2017 at 6:27 PM, Julien Le Dem <[email protected]> wrote:

> This looks like a bug in parquet-tools when printing the schema to the
> console.
> Possibly adding a @JsonValue annotation to intValue() [1] in Type would
> fix it.
> [1] https://github.com/apache/parquet-mr/blob/
> 89e0607cf6470dda1a6a47b46abf37468df4e50f/parquet-column/src/
> main/java/org/apache/parquet/schema/Type.java#L48
>
>
> On Jan 12, 2017, at 5:28 PM, James Pirz <[email protected]> wrote:
>
> Hi,
>
> I am trying to use a sample parquet file (generated via an existing example
> [1] in parquet-cpp) against parquet-tools [2] (in local mode) from
> parquet-mr project to check its content. However, parquet-tools can not
> read the schema and footer of the generated file successfully showing the
> following error.
> I am just wondering if it is happening because of a mis-match in the
> jackson library between parquet-cpp and parquet-mr or if it is more
> fundamental. My understanding is that no matter how the parquet file is
> generated (via parquet-cpp or some other library) it should be usable by
> all standard readers including parquet-tools.
>
> Here is the error:
>
> java -jar ./parquet-tools-1.9.1-SNAPSHOT.jar cat -j
>
> /home/user/Downloads/parquet_cpp_example.parquet
>
> Could not read footer: java.lang.RuntimeException:
> shaded.parquet.org.codehaus.jackson.map.JsonMappingException:
> No serializer found for class
> org.apache.parquet.schema.Type$ID and no properties
> discovered to create BeanSerializer (to avoid exception,
> disable SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS) )
> (through reference chain:
> org.apache.parquet.hadoop.metadata.ParquetMetadata["
> fileMetaData"]->org.apache.parquet.hadoop.metadata.
> FileMetaData["schema"]->org.apache.parquet.schema.
> MessageType["fields"]->java.util.ArrayList[0]->org.apache.
> parquet.schema.PrimitiveType["id"])
>
> James
> [1]
> https://github.com/apache/parquet-cpp/blob/master/
> examples/reader-writer.cc
> [2] https://github.com/apache/parquet-mr/tree/master/parquet-tools
>
>
>

Reply via email to