Class ParquetFooterReader
java.lang.Object
org.odpi.openmetadata.adapters.connectors.datastore.parquetfile.footer.ParquetFooterReader
ParquetFooterReader extracts the description of a Parquet file from its footer.
A Parquet file begins and ends with the four characters PAR1. Immediately before the final marker is the length of the footer, and before that is the footer itself. The footer is a structure called FileMetaData, defined in parquet.thrift, that is serialized using the Thrift compact protocol. It describes the schema, the number of rows, where the values for each column are located, how they are encoded and compressed, and statistics about them.
This layout has not changed since the first release of Parquet. Each new version of the format has added optional fields to the footer, and new ways to lay out, encode and compress the pages of values that it points to. Since this reader only decodes the footer, it works with files written to any version of the format, using any encoding or compression algorithm. It copes with the differences between the versions that do show up in the footer as follows:
A Parquet file begins and ends with the four characters PAR1. Immediately before the final marker is the length of the footer, and before that is the footer itself. The footer is a structure called FileMetaData, defined in parquet.thrift, that is serialized using the Thrift compact protocol. It describes the schema, the number of rows, where the values for each column are located, how they are encoded and compressed, and statistics about them.
This layout has not changed since the first release of Parquet. Each new version of the format has added optional fields to the footer, and new ways to lay out, encode and compress the pages of values that it points to. Since this reader only decodes the footer, it works with files written to any version of the format, using any encoding or compression algorithm. It copes with the differences between the versions that do show up in the footer as follows:
- Both the original converted type annotations and the newer logical type annotations are understood.
- The minimum and maximum values are taken from the newer statistics fields where they are present. The original fields are used only for the types of column where they are known to be correct.
- Both the standard layouts for lists and maps, and the legacy ones, are recognized.
- The version of the data page layout is taken from the footer where it is recorded. If it is not, the header of the first data page of each column is read to discover it.
- Fields that are not recognized are ignored.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
DATA_PAGE_V1
Name used for the original data page layout.- See Also:
-
DATA_PAGE_V2
Name used for the data page layout introduced in version 2 of the format.- See Also:
-
-
Constructor Details
-
ParquetFooterReader
public ParquetFooterReader()Default constructor.
-
-
Method Details