mirror of
https://github.com/asadbek064/hyparquet.git
synced 2025-12-05 22:41:55 +00:00
Fix early page termination for non-flat columns (#119)
This commit is contained in:
parent
709d6b41fc
commit
06a2c79123
@ -16,7 +16,8 @@ import { deserializeTCompactProtocol } from './thrift.js'
|
||||
* @returns {DecodedArray[]}
|
||||
*/
|
||||
export function readColumn(reader, { groupStart, selectStart, selectEnd }, columnDecoder, onPage) {
|
||||
const { columnName } = columnDecoder
|
||||
const { columnName, schemaPath } = columnDecoder
|
||||
const isFlat = isFlatColumn(schemaPath)
|
||||
/** @type {DecodedArray[]} */
|
||||
const chunks = []
|
||||
/** @type {DecodedArray | undefined} */
|
||||
@ -34,7 +35,7 @@ export function readColumn(reader, { groupStart, selectStart, selectEnd }, colum
|
||||
})
|
||||
})
|
||||
|
||||
while (rowCount < selectEnd) {
|
||||
while (isFlat ? rowCount < selectEnd : reader.offset < reader.view.byteLength - 1) {
|
||||
if (reader.offset >= reader.view.byteLength - 1) break // end of reader
|
||||
|
||||
// read page header
|
||||
|
||||
Loading…
Reference in New Issue
Block a user