diff --git a/package.json b/package.json index 4a26ce4..79753a6 100644 --- a/package.json +++ b/package.json @@ -32,9 +32,9 @@ "test": "vitest run" }, "devDependencies": { - "@types/node": "22.13.4", + "@types/node": "22.13.5", "@vitest/coverage-v8": "3.0.6", - "eslint": "9.20.1", + "eslint": "9.21.0", "eslint-plugin-jsdoc": "50.6.3", "hyparquet-compressors": "1.0.0", "typescript": "5.7.3", diff --git a/src/datapage.js b/src/datapage.js index 5d0b07c..1fcbd27 100644 --- a/src/datapage.js +++ b/src/datapage.js @@ -38,8 +38,12 @@ export function readDataPage(bytes, daph, schemaPath, { type }) { const bitWidth = type === 'BOOLEAN' ? 1 : view.getUint8(reader.offset++) if (bitWidth) { dataPage = new Array(nValues) - const encodedLength = type === 'BOOLEAN' ? 0 : view.byteLength - reader.offset - readRleBitPackedHybrid(reader, bitWidth, encodedLength, dataPage) + if (type === 'BOOLEAN') { + readRleBitPackedHybrid(reader, bitWidth, 0, dataPage) + dataPage = dataPage.map(x => !!x) // convert to boolean + } else { + readRleBitPackedHybrid(reader, bitWidth, view.byteLength - reader.offset, dataPage) + } } else { dataPage = new Uint8Array(nValues) // nValue zeroes } diff --git a/test/files/boolean_rle.json b/test/files/boolean_rle.json index 7c29a74..52479a1 100644 --- a/test/files/boolean_rle.json +++ b/test/files/boolean_rle.json @@ -1,17 +1,17 @@ [ - [1], - [1], - [1], - [1], - [1], + [true], + [true], + [true], + [true], + [true], [null], [null], [null], [null], [null], - [0], - [0], - [0], - [0], - [0] + [false], + [false], + [false], + [false], + [false] ]