| |
| |
| |
|
|
| import { BoundaryOrders } from './constants.js' |
| import { DEFAULT_PARSERS } from './convert.js' |
| import { convertMetadata } from './metadata.js' |
| import { deserializeTCompactProtocol } from './thrift.js' |
|
|
| |
| |
| |
| |
| |
| |
| export function readColumnIndex(reader, schema, parsers = undefined) { |
| parsers = { ...DEFAULT_PARSERS, ...parsers } |
|
|
| const thrift = deserializeTCompactProtocol(reader) |
| return { |
| null_pages: thrift.field_1, |
| min_values: thrift.field_2.map(( m) => convertMetadata(m, schema, parsers)), |
| max_values: thrift.field_3.map(( m) => convertMetadata(m, schema, parsers)), |
| boundary_order: BoundaryOrders[thrift.field_4], |
| null_counts: thrift.field_5, |
| repetition_level_histograms: thrift.field_6, |
| definition_level_histograms: thrift.field_7, |
| } |
| } |
|
|
| |
| |
| |
| |
| export function readOffsetIndex(reader) { |
| const thrift = deserializeTCompactProtocol(reader) |
| return { |
| |
| page_locations: thrift.field_1.map(loc => ({ |
| offset: loc.field_1, |
| compressed_page_size: loc.field_2, |
| first_row_index: loc.field_3, |
| })), |
| unencoded_byte_array_data_bytes: thrift.field_2, |
| } |
| } |
|
|