Skip to content

parquet write to s3 is not queryable by Athena #124

@zrizvi93

Description

@zrizvi93

Hello,

The parquet file generated by this library is compatible with Spark but not queryable using Athena.

I wrote a file to s3 and all array columns would break with the error GENERIC_INTERNAL_ERROR: null

AWS Premium Support told me that after doing a bit of research, the main reason for these issues is the different ways parquet files can be created. After using parquet-tools to inspect the sample data I provided they informed me that this is written in some hybrid parquet format.The parquet format generated by parquetjs allows for the final parquet file to exclude columns if that column is blank in the data. For example, if a record (row) does not have any value for the "x" column, then the "x" column is omitted from the actual parquet file itself.

Athena uses the Hive parquet SerDe (org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe). As a result, the SerDe expects that all columns will be present in the source parquet file. In this case, empty columns are not included within the record (row) of the parquet file. Unfortunately, the previously mentioned Hive parquet SerDe is the only parquet SerDe supported in Athena.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions