Class ParquetStatisticsDecoder
java.lang.Object
org.odpi.openmetadata.adapters.connectors.datastore.parquetfile.footer.ParquetStatisticsDecoder
ParquetStatisticsDecoder converts the minimum and maximum values that a writer saved in the footer of
a Parquet file into Java objects. The class of the object depends on the type of the column:
- Boolean - for boolean columns;
- Long - for integer columns;
- BigInteger - for unsigned 64-bit integer columns;
- Double - for floating point columns;
- BigDecimal - for decimal columns;
- LocalDate - for date columns;
- LocalTime - for time columns;
- Instant - for timestamps that are on the UTC timeline;
- LocalDateTime - for timestamps that have no time zone;
- String - for everything else: text is returned as is, a UUID in its standard form, and other binary values in hexadecimal.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Comparable<?> decode(byte[] value, ParquetSchemaElement column) Convert a value from the statistics.static Comparable<?> max(Comparable<?> first, Comparable<?> second) Return the larger of two values from the same column.static Comparable<?> min(Comparable<?> first, Comparable<?> second) Return the smaller of two values from the same column.static booleanusesSignedOrder(ParquetSchemaElement column) Return whether the values of a column are ordered using a simple signed comparison.
-
Method Details
-
usesSignedOrder
Return whether the values of a column are ordered using a simple signed comparison. The minimum and maximum values written to the original statistics fields (by writers from before 2017) were always calculated this way, whatever the type of the column. This means they are only correct for these columns.- Parameters:
column- description of the column- Returns:
- boolean
-
decode
Convert a value from the statistics.- Parameters:
value- value as stored in the filecolumn- description of the column that the value is from- Returns:
- comparable object, or null if the value is missing or not usable
-
min
Return the smaller of two values from the same column.- Parameters:
first- value (may be null)second- value (may be null)- Returns:
- the smaller value, or the value that is not null
-
max
Return the larger of two values from the same column.- Parameters:
first- value (may be null)second- value (may be null)- Returns:
- the larger value, or the value that is not null
-