mirror of
https://github.com/asadbek064/hyparquet.git
synced 2026-01-06 19:26:36 +00:00
Fix handling of boolean rle
This commit is contained in:
parent
312557a83a
commit
2a302702d4
@ -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",
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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]
|
||||
]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user